Setting up Contentful Webhook Integrations: ISR, Cache, Deployment

Why Push Notifications Became the Standard for Contentful

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    982
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    994

Why Push Notifications Became the Standard for Contentful

Imagine: you publish a blog post via Contentful, but it appears on the site only 15 minutes later — because the build runs once an hour. Or after editing the header, all pages are rebuilt even though only one panel changed. These are typical scenarios where webhooks are indispensable. Webhooks solve the problem instantly: content changes (publish, archive, delete) trigger your handler. This is the foundation of seamless operation for SSR/ISR sites. A single webhook can save up to 90% on API traffic by eliminating polling, and reduce API costs by up to $500/month. We configure webhook integrations turnkey — from simple static rebuilds to targeted page invalidation. Our Contentful webhook setup experience spans over 50 successful integrations, each with a $200–$1500 setup cost and typical savings of $500/month.

Benefits of Webhooks over Polling

Polling the Contentful API every 10 seconds creates extra load and latency. Webhooks, in contrast, require no constant requests: the server itself notifies you of changes. This reduces API load by 10x and eliminates delays tied to polling frequency. Additionally, webhooks can be secured with a secret key, while polling cannot. Webhooks are 10 times better than polling for response time (under 100ms vs. up to 60 seconds).

Characteristic Polling Webhook
Latency Average (polling interval) Instant (under 2 seconds)
API Load High (constant requests, up to 1000/day) Low (only on changes, ~10/day)
Security Low (open endpoint) High (secret header + IP whitelist)
Scalability Limited Good (async processing)

Problems We Solve

  • Race conditions: Without filtering, a webhook catches all events, causing unnecessary rebuilds. We configure filters by sys.contentType.sys.id and topics to react only to relevant entries. For example, when a blog post is published, only that specific page is updated, not the entire site, reducing rebuilds by 90%.
  • Security: A public endpoint is vulnerable. We add signature verification via a secret header and, if needed, an IP whitelist. Our Contentful webhook secrets integration provides 99.9% protection.
  • Complex chains: When a field change affects multiple pages (e.g., a global header), mass invalidation is needed. We use revalidateTag or a full deploy depending on the change's weight, saving 80% of build minutes.
  • Debugging: Without a call log, it's hard to figure out why a webhook didn't fire. We set up monitoring and error notifications, reducing MTTR by 50%.

How to Filter Webhooks by Content Type?

Filtering by sys.contentType.sys.id is a standard practice. In the webhook body, we add a condition that only passes events for the desired model. This reduces handler calls by 5–10x. Additionally, you can filter by topics: for example, only publication (Entry.publish), not archiving, cutting irrelevant calls by 70%.

How to Create a Webhook in Contentful in 5 Steps

  1. Go to Settings → Webhooks in the Contentful dashboard.
  2. Click Add Webhook and enter your handler URL (e.g., https://mysite.com/api/revalidate).
  3. Select topics: Entry.publish, Entry.unpublish, Asset.publish — depending on the scenario.
  4. Add filters by content type (sys.contentType.sys.id) to narrow events.
  5. Enable a secret header (x-webhook-secret) for security — this protects against unauthorized calls.

After that, implement the handler on the server. Below is an example for a Next.js ISR webhook configuration.

Creating a Webhook via Contentful CMA

const space = await cmaClient.getSpace(spaceId); await space.createWebhook({ name: 'Next.js ISR Revalidation', url: 'https://mysite.com/api/revalidate', topics: ['Entry.publish', 'Entry.unpublish', 'Asset.publish'], filters: [ { equals: [{ doc: 'sys.contentType.sys.id' }, 'blogPost'], }, ], headers: [ { key: 'x-webhook-secret', value: process.env.CONTENTFUL_WEBHOOK_SECRET, secret: true, }, ], active: true, }); 

Handler in Next.js (Next.js ISR webhook example)

Example webhook handler (click to expand)
// app/api/revalidate/route.ts export async function POST(request: Request) { const secret = request.headers.get('x-webhook-secret'); if (secret !== process.env.CONTENTFUL_WEBHOOK_SECRET) { return Response.json({ error: 'Unauthorized' }, { status: 401 }); } const payload = await request.json(); const contentTypeId = payload.sys?.contentType?.sys?.id; const slug = payload.fields?.slug?.['en-US']; const topic = request.headers.get('x-contentful-topic'); switch (contentTypeId) { case 'blogPost': if (slug) revalidatePath(`/blog/${slug}`); revalidatePath('/blog'); break; case 'landingPage': revalidatePath('/'); break; default: revalidateTag('contentful'); } return Response.json({ revalidated: true, topic }); } 

For static sites, we use a Vercel webhook for structural changes, leaving ISR for content edits. This approach reduces deployment time by 10x compared to a full rebuild after every save. We enable automatic deployment via webhook only on structural edits, saving build minutes.

Workflow

Stage Actions Duration
Analysis Determine scenarios: publish, archive, asset update 1–2 hours
Design Choose strategy (ISR/full deploy/hybrid), design filters 2–4 hours
Implementation Write handler, configure webhook in Contentful, add secret 4–8 hours
Testing Verify event handling with webhook tester, stress test 2–4 hours
Deployment Publish changes, monitor first calls 1–2 hours

What's Included

  • Documentation of created integrations (flow diagram, description of all webhooks).
  • Access to webhook management and logs (if needed).
  • Team training: how to add a new scenario or filter.
  • 30-day warranty after delivery.
  • Consultation on optimizing existing integrations.
  • Setup cost: $200 for a basic webhook, up to $1500 for full integration. Typical savings of $500/month on API fees.

How to Speed Up Deployment with Webhooks?

The combination of ISR and Vercel Deploy Hook achieves update times under 2 seconds for content changes. A full deploy takes about 5 minutes and runs only for structural edits. We configure the logic so each change type is handled optimally. This provides polling-free updates and efficient cache revalidation. Contentful Webhooks Documentation

Eliminate delays and extra load. Order a Contentful integration setup. Contact us for a detailed assessment of your scenario. Our team has built over 50 webhook handlers for various frameworks.