Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
In AEM as a Cloud Service with Adobe-managed Akamai, I’m triggering a CDN purge for specific paths right after activating content to publish.
Occasionally, users get 404s or stale content for a few seconds to minutes, which suggests a race condition where the CDN purge happens before the newly published content is fully available on all publish instances.
What’s the best practice to ensure that a purge request to the CDN happens only after all publish instances are serving the updated content?
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
Hi @NamitaDu,
Agree with @PavanGaddam and yes he is right it's a Fastly.
this is a sequencing issue. In AEM as a Cloud Service, content activation to publish is asynchronous across all publish instances. If you trigger a Fastly purge immediately after activation, the CDN can request the new asset/page before it’s available everywhere, resulting in 404s or stale content.
Best practice:
Wait for replication success events
Use the AEM ReplicationEventListener (for classic replication) or the Sling Job/Workflow completion listener for CF/Assets.
This ensures you only act after the content has been persisted on all publish nodes.
Add a short buffer delay
Even after the event fires, add a few seconds (e.g., 2–5s) to allow all publishers in the cluster to serve the new content.
Purge via Adobe’s Fastly API
Use the aio-cli or direct HTTP call to POST /service/{id}/purge/{path} with your Adobe-provided Fastly service ID and API token.
References:
Vistas
Respuestas
Total de me gusta
It is always a best practice to use the Cache-Control header configuration for CDN caching strategy than depending on the manual CDN cache purge. For the time critical resources on your site, you can use manual CDN cache purging. You may get a stale content for some time depending on the max-age value defined for Cache-Control header in dispatcher configurations and the /gracePeriod defined in dispatcher.
BTW, the OOTB CDN in AEM CS is Fastly, not Akamai.
Vistas
Respuestas
Total de me gusta
Hi @NamitaDu,
Agree with @PavanGaddam and yes he is right it's a Fastly.
this is a sequencing issue. In AEM as a Cloud Service, content activation to publish is asynchronous across all publish instances. If you trigger a Fastly purge immediately after activation, the CDN can request the new asset/page before it’s available everywhere, resulting in 404s or stale content.
Best practice:
Wait for replication success events
Use the AEM ReplicationEventListener (for classic replication) or the Sling Job/Workflow completion listener for CF/Assets.
This ensures you only act after the content has been persisted on all publish nodes.
Add a short buffer delay
Even after the event fires, add a few seconds (e.g., 2–5s) to allow all publishers in the cluster to serve the new content.
Purge via Adobe’s Fastly API
Use the aio-cli or direct HTTP call to POST /service/{id}/purge/{path} with your Adobe-provided Fastly service ID and API token.
References:
Vistas
Respuestas
Total de me gusta
Refer to this WKND Github repository for the caching best practices.
Vistas
Respuestas
Total de me gusta
Thanks for expanding on this - you’re absolutely right that under a properly configured AEMaaCS + Dispatcher + CDN setup, cache misses should always fall back to Publish and a 404 should only occur if the page truly isn’t available yet (unpublished, activation in progress, or origin issue).
The main intention of my note was to highlight that if users are seeing 404s immediately after cache purges, it usually indicates either:
Publish didn’t have the content available yet, or
Dispatcher/CDN isn’t fully forwarding misses to origin correctly.
In most healthy configurations, users should never face a transient 404 purely because of cache invalidation.
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas