How Strapi webhooks trigger static site rebuilds
Strapi webhooks can call a build hook or a cache purge endpoint when content changes, and the design work is deciding which events and content types count as a reason to rebuild. A team whose editors publish in Strapi while a static front end serves yesterday's pages needs this wiring when the gap between publishing and visibility matters, for example a news or pricing page that must update within minutes. A scheduled build fits content that changes on a predictable cycle, and on-demand rendering fits pages that must reflect every request. Many teams combine a scheduled build as a safety net with event-driven triggers for the pages editors care about most. The framework specifics for Astro and Nuxt are covered on their sibling pages, so this section stays with the Strapi side of the connection.
Start by listing the events your Strapi version emits for entries, media and publishing states, and confirm the exact event names and payload shape against your version's documentation before writing any receiver code. Do not assume a payload field exists because a similar CMS has it. Then map each event to the content types that actually appear on the static site. A change to an internal author type or a draft preview may not need a rebuild at all, while a change to a shared navigation component may affect every page. Record that mapping in a table your editors and front-end developers both review, because it becomes the rule set you test and maintain.
Plan for rebuild storms before they happen. A bulk import, a scheduled publish of many entries, or an editor saving repeatedly can fire many webhook calls in a short window, and each one can start a full build. Decide how the receiver debounces or queues requests, whether it collapses duplicate triggers into one build, and how long builds take on your hosting. Treat the build hook URL as a secret: it should be stored outside the content model, rotated when staff change, and called only from your Strapi server or a trusted receiver. Ask your front-end host how it enforces concurrency and whether it supports cache purges separately, and test both paths in a staging environment with realistic publish volumes.
Which Strapi events should trigger a build
Publishing is the event that changes what the public site should show. In Strapi 5, draft and published versions are stored separately, so a publish event signals that the published version now differs from the last build. An unpublish event removes an entry from the public API, so for the site it has the same effect as a delete, even though the record remains in the admin panel.
- Publish starts a build or purge: Map entry publish to the rebuild or revalidation job for every page that reads that content type.
- Unpublish follows the removal path: Pages that rendered the entry must stop being served, so route unpublish through the same logic as deletion.
- Scheduled changes may arrive in batches: Confirm whether scheduled or release-based publishing fires one event per entry or groups them, because batches can start one build for many changes.
- Relations widen the impact: Publishing a category can change listing, navigation and sitemap pages even though its own page is unchanged.
In a staging project, publish and unpublish one test entry, then confirm the job you expect runs and record the exact event names your Strapi version sends in the webhook settings.
A draft save and a publish are different events. Editors save drafts many times while writing, and an update event can fire on each save of the draft version. If the hook builds on every update, the site rebuilds for content no one has approved for the public, and frequent saves can queue overlapping builds. Build triggers should follow the published state, while the preview experience reads from drafts.
- Update events fire on drafts: Filter so only published-state changes start a site build, or check the status in the webhook payload before calling the hook.
- Autosave bursts: Coalesce bursts of events into one build with a short debounce window in the receiving service.
- Preview stays on drafts: Keep preview requests on the draft API and keep build triggers off that path.
- Payload fields differ by version: Check which fields identify the entry state in the webhook body before you write the filter.
Test by saving a draft several times and confirming that no production build starts, then publishing once and confirming that exactly one build runs.
Deletions are the event most likely to leave stale content online. A static site removes a page only when the build no longer generates it. A delete event that only triggers a rebuild can still leave old HTML in place if the host or CDN keeps files, or if the list of pages comes from a cached build. The site needs a path that rebuilds the page list and purges the removed URLs.
- Handle delete and unpublish together: The public page disappears in both cases, so both should reach the same removal logic.
- Fetch the current slug list: Make sure the build reads live slugs from Strapi rather than a cached list from the previous run.
- Purge the removed URL: Send a cache purge for the deleted path and any listing pages that linked to it, not only a full rebuild.
- Plan redirects: Decide whether removed pages need redirects, and keep those rules in content or configuration that the build reads.
- Include embedded references: Pages that embedded a deleted media file or related entry also need a rebuild.
After a test deletion, request the old URL from the edge once the job finishes and confirm it returns the status your redirect or 404 policy expects.
Media and locale events affect pages in less obvious ways. Replacing an image may change only a file URL, while adding a locale can create new variants of entries that need their own routes, listings and language switchers. Both should be mapped on purpose, because a broad rule can rebuild the whole site on every upload.
- Media updates need a reference check: Rebuild pages that use the asset if your pipeline can identify them; otherwise, decide whether purging the asset URL is enough.
- Unattached uploads stay quiet: Uploads that no published entry references should not start a site build.
- New locales change the route set: A new locale can add routes, sitemap entries and navigation, so include it in the build scope.
- Each locale has its own publish state: Confirm which locale the event belongs to, so you rebuild only the affected language paths.
- Sitemaps and feeds follow the URL set: Regenerate them whenever publish, locale or deletion events change which URLs exist.
In staging, upload one asset and create one test locale, then confirm the webhook payloads identify the locale and related entry, and that the build scope matches the change.
Webhook configuration options and when each fits
This table compares the main webhook choices for a static site rebuild: which content types to subscribe, which events to send, what the build target does, and whether to batch changes. Read each row for the cost of a rebuild against how quickly editors see their changes live. The main takeaway is that narrow subscriptions and batching usually protect the build pipeline better than broad, immediate triggers.
| Option | When it fits | Trade-off |
|---|---|---|
| Subscribe to specific content types | Only a few collections or single types change the rendered pages, such as articles or navigation | Fewer unnecessary builds, but any new content type that affects pages must be added to the subscription list |
| Subscribe to all content types | Almost every entry feeds the site, and the team prefers simple configuration | Editing unrelated content, such as internal reference data, can start builds that change nothing visible |
| Entry publish and unpublish events | Editors expect a page to appear or disappear once it is published or withdrawn | Each save of a draft is not sent, so drafts do not appear on the live site, but every publish can start a build |
| Entry update and delete events | Content that is already published changes often, or deleted entries must leave the site | Frequent edits to a published entry multiply builds, so pair these events with filtering or batching |
| Full build hook | The site is small, the framework has no incremental build, or template changes need a complete rebuild | Highest build cost per trigger and the longest wait before changes are visible |
| Incremental or on-demand rebuild | The framework or host can rebuild only changed pages, and the site has many pages | Lower build cost, but the logic that maps a changed entry to affected pages must be designed and tested |
| CDN or cache purge only | Pages are server rendered or cached, and the change affects cached responses rather than generated files | Fast and cheap, but it does not help when the output is a static file that must be regenerated |
| Batched or debounced triggers | Editors make many small changes in a session, or bulk imports touch many entries | Fewer builds and lower cost, but changes can wait for the batch window before going live |
| Immediate per-event triggers | Freshness matters more than build cost, such as breaking news or time-limited offers | Risk of rebuild storms during bulk edits, so confirm build queue behavior with the hosting provider |
Avoiding rebuild storms from bulk edits
A single bulk import, scheduled publish or locale rollout can fire a webhook for every entry it touches. The controls below sit at different points in the chain, from the Strapi event subscription to the build provider, and they work best together.
Batch events on the receiver
Strapi sends one webhook per entry event, so a bulk import of several hundred entries can arrive as a burst of requests. The receiver should collapse these into a single pending trigger that waits for a quiet period before calling the build hook. Check how long the quiet window is, whether it resets on each new event, and what happens to events that arrive while a build is already running.
Skip draft-only changes
Editors save drafts constantly, and most of those saves do not change anything a visitor sees. Filter on the event type and the content type the front end actually reads, and ignore updates that touch only internal fields such as editorial notes or review status. Confirm with the front-end team which fields feed the built pages, because a filter that is too strict will leave published content stale.
Keep a single pending build
If several triggers arrive while a build runs, the safest pattern is to allow one running build and one queued build, dropping any extra requests into that queue. Without this rule, each webhook can start a parallel build that competes for the same build minutes and publishes out of order. Ask the team to test a rapid sequence of publishes and confirm the last content change is the one that goes live.
Respect build provider rate limits
Hosting platforms cap how many builds a project can start and how many they run concurrently, and those limits differ by provider and plan. Read the provider's documentation for build concurrency and queue behavior before go-live, and confirm what happens when a limit is reached: whether builds are dropped, delayed or failed. A receiver that retries aggressively can exhaust the limit that it was meant to protect.
Plan for scheduled and locale rollouts
Scheduled publishing of many entries and a new locale going live are predictable bulk events, so they can be planned. Agree with editors a publish window or a single batch release, and have the team check whether the receiver treats the batch as one event. For locale rollouts, confirm that a build is triggered once after all locale content is in place rather than once per locale.
Filtering by content type without missing dependencies
A rebuild decision should follow what a page renders, not only the content type that was edited. A change to an author, a category or a shared component can alter dozens of pages that never mention that type in their own URL or template. If the webhook filter only checks the edited model value, an updated author bio will leave every article that shows it stale until the next unrelated build. The receiver therefore needs a dependency map: a written list, per front-end route, of the Strapi content types, components and dynamic zone blocks that feed the rendered output. Build that map from the front end's query code, not from the editors' memory of the content model. Search the fetch calls for populate parameters, nested relation names, component fields and dynamic zone handlers, and record which route consumes each one. Shared layout data such as navigation, footer settings and site-wide single types usually belongs in the map too, because nearly every page depends on it.
The filter itself is a trade-off. A narrow filter, such as rebuilding only on entry.publish for article entries, is cheap and quiet but misses pages that depend on authors, taxonomies or components, and those errors surface later as stale content that editors report. A broad filter, such as rebuilding on every event for every type, never misses a dependency but multiplies builds, slows the queue and makes it harder to tell which change caused which deploy. Most teams settle between these by filtering on the dependency map: each event carries the content type and the affected entry, and the receiver triggers only the routes that consume that type. Test the map before trusting it. Publish a test author change in a staging environment, confirm which pages rebuild, and compare that list with the routes the map predicts. Revisit the map whenever a developer adds a populate clause or a new dynamic zone block, since those changes are easy to make in a front-end pull request without anyone updating the webhook rules.
Setting up the webhook and build hook
This sequence connects Strapi content events to a controlled rebuild and cache purge pipeline, so that editors see changes on the live site without every save triggering a build. Each step ends with a check you can run before the setup reaches production.
Define the rebuild matrix
Before touching any configuration, list every content type and component that appears on the site, then map each one to the events that should trigger a rebuild: entry create, update, publish, unpublish and delete, plus media changes if images are baked into pages. Mark which types affect only one route and which affect shared pages such as navigation, footers or sitemaps, because shared content is what makes a single save expensive. The owner is usually the front-end lead working with an editorial representative. The matrix is done when every event on every type has a stated outcome, either a full build, a targeted purge or no action.
Create the build hook or purge endpoint
In the hosting platform for the static site, create a deploy hook or build trigger that starts a build for the production branch, and if the site uses a CDN with an API, create a purge credential scoped to the zones you need. Store the hook URL and any token in a secrets manager or the host's environment settings, not in the repository or the Strapi admin. Confirm the exact trigger mechanism and its rate behavior with your hosting provider, since the features differ between platforms. The step is complete when a manual call to the hook starts one build and the build log shows the expected branch.
Build the receiver with validation and debouncing
Deploy a small receiver service, such as a serverless function or a route in your existing backend, that sits between Strapi and the build hook. It should reject requests without a valid shared secret or signature, check that the payload's model name is on the rebuild matrix, and then queue the request in a debounce window so that a burst of saves produces one build. Keep the window and the queue logic in configuration so editors and engineers can review them. The check is a test run with ten rapid saves to one type, which should produce a single build call and a log line showing the other requests were folded in.
Configure the Strapi webhook
In the Strapi admin, open Settings, then Webhooks, and create a webhook that points to the receiver URL over HTTPS. Select only the events from the matrix, and include the secret header your receiver expects. Confirm in the Strapi documentation for your version how the webhook payload is structured and which headers it sends, since the field names your receiver parses depend on it. Record the webhook configuration in your deployment repository or runbook so it can be recreated on a new environment. The check is that a test delivery from the Strapi admin reaches the receiver and appears in its logs with the expected model and event names.
Test on a staging site first
Point the webhook and the build hook at a staging site and run the four content actions that matter most: draft save, publish, unpublish and delete, each on an entry that appears on a listed page. After each action, confirm that the receiver accepted the event, that the build ran once for the batch, and that the staging page reflects the change. The owner should be an engineer with an editor present so both the technical and editorial results are checked. Only move to production when every action has a recorded pass, and note any event that triggers a build you did not expect.
Verify purges return fresh content
For any route served through a CDN with cache purging, pick a URL, request it, change its entry in staging, wait for the purge to finish, and request the URL again. Compare the response body and cache headers with the new content, and repeat for an unpublish, where the page should return a not-found response or the expected fallback. Also check a shared page, such as navigation, to confirm the purge reaches every cached route that depends on it. The step is complete when the purged URL returns fresh content in each case and the cache status moves from a hit to a miss at the expected point.
Document the runbook and alerts
Write a short runbook covering the rebuild matrix, the hook and token locations, the debounce settings, how to disable the webhook during a content migration, and how to replay a missed event. Add alerts for failed build triggers and for receiver rejections, so an invalid secret or a broken hook does not go unnoticed. Confirm with your team who responds to these alerts outside working hours, since that ownership is set by your organization rather than by the setup itself. The step is complete when someone who did not build the pipeline can follow the runbook to trigger, pause and check a rebuild.
Request flow from Strapi event to rebuilt site
The flow starts when an editor publishes an entry in Strapi, which sends a webhook to a small receiver you run inside your own network. The receiver checks the shared secret or signature on the request, drops events for content types that do not affect the site, and waits for a quiet period so a burst of edits becomes one build. Only then does it call the build hook or purge the CDN, and the static host serves the new output. Check that the trust boundary is crossed only by the signed request and the build call.
Editor action flows through a filtered, verified receiver to a rebuilt static site.
Securing the build hook and webhook receiver
A build hook is a URL that starts a build when called, so anyone who holds it can trigger builds or purge caches. The controls below cover how the hook is stored, how the receiving side accepts requests, who can change webhook settings in Strapi, and how triggered builds are recorded.
Treat the hook URL as a credential
A build hook URL usually contains a token that authorizes the build provider to start a deployment. Anyone who sees it in a screenshot, a log line or a shared chat can start builds without a Strapi login. Confirm that the hook is never printed in CI logs, support tickets or documentation, and that it is listed in your credential inventory with an owner and a purpose.
Store the hook in a secret manager
Keep the hook URL in your secret manager or the CI secret store, not in the Strapi webhook form as plain text that every admin can read. Inject it at deploy time so that changing it does not require a code change. Ask who can read the secret, whether reads are logged, and whether the secret store is the same system your team already audits.
Restrict the receiver to expected sources
The receiver is the endpoint that accepts Strapi webhook calls and forwards them to a build. Where your network and hosting allow it, accept requests only from the Strapi instance's outbound addresses, and reject everything else at the load balancer or web application firewall. Check the Strapi documentation and your provider's docs to confirm whether signed payloads are supported for your setup before relying on them.
Plan hook rotation
Rotate the hook when staff with access leave, when a secret may have leaked, and on a fixed schedule set by your security policy. Rotation means creating a new hook, updating the secret store, updating the webhook URL in Strapi, and then revoking the old hook. Test the sequence on a staging project first so that a rotation does not leave content changes unpublished on the live site.
Limit who can edit webhook settings
Anyone who can edit a Strapi webhook can point it at a new destination or reveal the existing configuration. Restrict webhook administration to a small group of platform engineers through Strapi roles. Access depends on how the admin panel is protected, including the admin role setup and whether admin login uses SSO with a local login lock-out, so review those settings together with this control.
Strapi SSO docsLog every triggered build
Record each hook call with its time, the event name, the content type, and the build ID that resulted. Keep these records alongside the Strapi audit trail if your plan includes audit logs, and in your CI system otherwise. Unexplained builds are often the first sign of a leaked hook or a misconfigured webhook, so set an alert for build volume that exceeds what editorial activity explains.
Questions teams ask before rebuilding sites from Strapi
Is a Strapi webhook alone enough to rebuild a static site?
A webhook is enough to start a rebuild, but it does not decide what should rebuild, when to wait, or how to protect the endpoint that starts the build. Strapi sends an HTTP request when entries are created, updated, published or deleted, and your receiver must read the payload, check the content type and call the hosting platform's build API. Teams that stop there often rebuild the whole site for every small edit and get bursts of builds during bulk imports. The receiver needs filtering, debouncing and a signed or secret-protected request. Expect the webhook to be the trigger and the receiver to be the part that needs design.
What drives the cost of a Strapi rebuild setup?
Cost comes from four areas: build minutes on your hosting platform, receiver and cache-purge work, mapping which content types affect which pages, and testing the publish path end to end. Build minutes recur with every triggered build, so the number of pages, the build time per page and the frequency of editorial changes matter most. Receiver work is usually a small one-time build. Dependency mapping grows with the number of relations, components and shared navigation or footer content. Testing covers draft versus published states, deletes and failed builds. Ask any quote to separate one-time design and build from recurring hosting and build costs, and to state which events and content types it assumes.
How long does setup take for a Strapi content model?
Setup time depends mainly on how many content types, components and relations feed the site and how many routes depend on them. A model with a few collection types and a single navigation component is a much smaller job than one with dynamic zones, nested components and content pulled into shared layouts, because each dependency must map to the pages it changes. The receiver itself is typically quick to build. Most of the schedule is spent on the mapping, on testing bulk operations and on confirming build hook behavior with the front-end host. Ask for a timeline that is tied to a written list of content types and pages, and confirm the figure against your own content model before agreeing to it.
What must our team provide for a rebuild integration?
You need to provide the content model, the front-end query code, and access to the hosting platform and the Strapi instance. The content model shows which types and components exist and how they relate. The front-end query code shows which fields each page reads, which is the basis for deciding which events matter. Hosting access covers the build hook or deploy API, environment variables for the secret, and the cache or CDN settings used for purges. Access to a staging Strapi instance is needed to test publish, unpublish and delete events without disturbing editors. Also name an owner for the editorial rules, such as which content should publish immediately and which should wait for a scheduled release.
Can an in-house developer build Strapi webhook rebuilds?
Yes, a developer who knows the front-end framework, the hosting platform's build API and basic HTTP security can build a working version. The harder parts are design choices that are easy to get wrong: filtering by content type, debouncing bursts, avoiding loops where a build writes back to Strapi, and protecting the endpoint from forged calls. Those choices need review by someone who has run the site under editorial load. If your team has no capacity for on-call work on the build pipeline, plan for ownership of the receiver, its logs and its failure alerts. A partner can design and build the integration in a fixed scope, and your team can then run and extend it.
When do incremental builds or on-demand rendering replace webhook rebuilds?
Incremental builds or on-demand rendering become the better choice when rebuild time grows large or editors need changes visible within seconds. Full rebuilds triggered by webhooks work well for sites with moderate page counts and content that changes in batches. Once builds take long enough that frequent triggers queue up, or when most pages are rarely visited, rendering pages on request or regenerating only affected paths reduces wasted builds. Server rendering adds runtime hosting cost and cache design work, so it is not automatically cheaper. Ask the front-end framework's documentation and your hosting provider which revalidation options they support, and compare them against your measured build time and publish frequency.
How do we stop rebuild storms and secure the build hook?
Stop storms by filtering events to the content types that affect the built output, grouping bursts with a short quiet period before triggering one build, and skipping events for drafts that do not reach the public site. Secure the hook by keeping its URL and any token in environment variables, validating the request source or secret on the receiver, and rejecting unexpected event types. Log every accepted and rejected call so you can see a flood or a forged request. Test bulk imports and scheduled releases, since they produce many events in a short window. Confirm the exact webhook payload fields and signing options in the Strapi version you run before writing the receiver.
Does our Strapi version change how webhooks behave?
Yes, version and hosting choices affect the payload you parse, the events you can subscribe to and the upgrade work that follows. Strapi 5 changed API response formats and replaced the Entity Service API with the Document Service API, so receivers that read entry identifiers or response shapes from an older release need review. Strapi 4 reached end of life on April 30, 2026, so teams still on it should plan the upgrade before adding new integration work. Confirm which events and payload fields your running version sends, and check them against the migration notes before deciding on the receiver design.
Operating the pipeline after launch
The rebuild pipeline needs an owner after launch, because most failures show up as stale pages or a build queue that never drains rather than as an error on a screen. Start by recording, for every build the Strapi webhook triggers, the event name, the content type, the entry identifier, the time the build started and finished, and the result. Your CI system or hosting platform should expose build success rate and build duration per day. A rising duration usually means the site has grown or that a content type with many relations now triggers a full rebuild instead of a partial one. Confirm with your front-end host which of these metrics it keeps and for how long, since that sets how far back you can investigate a stale-content report.
Alert on two conditions, not one. A failed build is the obvious case. A looping build is the dangerous one: a publish event that triggers a build, where the build writes back to Strapi (for example, a cache-warming job that updates an entry), can fire the same webhook again and again. Set an alert on the number of builds started within a short window, and a separate alert when the same entry identifier appears in consecutive builds. Route both to the team that owns the front end, not only to the people who maintain Strapi, because they are the ones who can pause the hook. Document the step that disables the hook or the build trigger, and test it once in a non-production environment.
Webhook configuration drifts after schema changes. When an editor adds a content type, renames a field or adds a component, the events and content type filters you set at launch may no longer match what editors publish. Review the webhook list after every schema change that reaches production, and before each release that touches content modeling. Run each new or changed content type through your rebuild test matrix: publish, update, unpublish and delete, in draft and published states where your workflow uses them. Keep the receiver endpoint, the signing or secret handling, and the build hook definition in the same version control and change approval process as the front-end code. A hook that someone edited in an admin screen without a record is the most common reason a fix cannot be reproduced. For the operational side of Strapi, see Strapi backups and operations and the Strapi deployment and hosting guidance.
How DeployOpen scopes and delivers static site rebuild integrations
DeployOpen treats the Strapi-to-build connection as a small, owned integration with its own scope, tests and runbook. We agree the events, content types, build targets and cache steps in writing before work starts, then build and verify the hook inside the infrastructure you control. Engagements are fixed-scope, and ongoing support is available as a retainer.
How we scope
- Inventory every content type and field editors change, and mark which ones should trigger a rebuild or cache purge.
- Agree the webhook events to subscribe to, such as publish, unpublish and update, and document why each one is needed.
- Record the build targets, hosting provider, cache layers and expected editorial publishing pattern in the written scope.
How we build
- Configure the Strapi webhook with filters by model and event, and add a debounce or batching step so bursts of edits do not start parallel builds.
- Secure the build hook with a secret or signed request check, and keep the target URL and token in your secrets store, not in content.
- Test each path in a staging environment, including a burst of saves, a failed build and a purge that removes the expected cached pages.
How we hand over
- Deliver the webhook configuration, build pipeline changes and cache purge scripts as versioned code in your repository.
- Write a runbook covering how to pause the hook, rerun a build manually and read build logs when a rebuild fails.
- Walk your editors and platform team through which content changes trigger which builds, so expectations match behavior.
How we support
- Review build frequency and failures after launch and recommend filter or debounce changes if rebuilds run more often than planned.
- Keep the hook current through Strapi upgrades, since webhook payloads and admin behavior can change between releases.
- Offer ongoing support, upgrades and continuous testing as a retainer, with the scope of each agreed in writing.

