
Astro ISR for Magento 2 — Instant Headless Cache Invalidation
Astro ISR keeps a statically-built headless storefront accurate the moment your catalogue changes. When a product, category, CMS page or block is saved in Magento 2, it fires a secure purge webhook to your Astro deployment — Netlify Functions, the Cloudflare Cache-Tag API, or a self-hosted targ…
A static storefront is fast — until your prices are an hour out of date
Headless stores get their speed by serving pre-built static pages, but that creates a new problem: when you change a price, update stock or edit a CMS block in Magento, the live site keeps showing the old version until something rebuilds it. Rebuild everything on every save and you're slow and wasteful; rebuild on a timer and your storefront is always a little stale. Astro ISR solves it the right way — the moment content changes, it tells your frontend to regenerate exactly the pages affected, and nothing else.
What you'll use it for
- Keep prices and stock honest — a price or availability change reaches the static storefront immediately, not on the next scheduled build.
- Publish content instantly — edit a CMS page or block and see it live on the headless front end within seconds.
- Migrate without downtime — purge two deploy targets at once while you move from one host to another.
- Avoid full rebuilds — regenerate only the pages that changed, saving build minutes and keeping the site fast.
How it works
Targeted, secure, and platform-aware
It purges precisely, and it doesn't trust the open internet. Changes are tagged so only the affected pages regenerate — not a full site rebuild. Every webhook carries a shared bearer secret that your Astro endpoint verifies, so nobody can trigger purges but Magento. The receiver knows the difference between platforms, dispatching to Netlify's purge, Cloudflare's Cache-Tag API, or a self-hosted no-op as appropriate, and a Redis pub/sub channel handles dual-layer CMS-block purging across an edge cache and the Astro local cache. Because the webhooks are fire-and-forget, the editor saving content never waits on the frontend.
Specifications
| Triggers | Product, category, CMS page and CMS block changes via observers |
|---|---|
| Targeting | Tag-based purge of affected pages only — no full rebuild |
| Platforms | Netlify Functions purge, Cloudflare Cache-Tag API, self-hosted target |
| Multi-deploy | Multiple webhook URLs purged together (blue-green / migrations) |
| Security | Shared bearer secret verified by the Astro endpoint |
| Redis | Pub/sub channel for dual-layer CMS-block purge (edge + Astro local cache) |
| Performance | Fire-and-forget webhooks; optional debug logging |
| Delivery & licence | Composer install, per-domain licence key, updates via Composer |
Works with
Part of the AgenticEcom suite for Headless & Astro:
Pairs with Astro CORS and keeps the CMS Sync Bundle content fresh. Included in the Enterprise bundle and the Astro frontend licences.
Frequently asked questions
Does it rebuild my whole site on every change?
No. Changes are tagged so only the affected pages — the product, category, page or block you edited — regenerate. That keeps your storefront fresh without burning build minutes on a full rebuild.
Which hosting platforms does it support?
The receiver dispatches to Netlify Functions purge, the Cloudflare Cache-Tag API, or a self-hosted target, depending on where your Astro storefront is deployed.
Can I purge two deployments at once?
Yes. List multiple webhook URLs and they're all purged together — useful during a migration or blue-green cut-over between an old and a new deployment.
Is the purge endpoint secure?
Yes. Every webhook carries a shared bearer secret that your Astro endpoint verifies, so only Magento can trigger a purge. The calls are fire-and-forget, so saving content in the admin stays fast.
Which Magento and PHP versions are supported?
Magento Open Source 2.4.9 and later 2.4.x, verified on PHP 8.4 and 8.5.

