Content Fragment updates aren’t reflected on CDN endpoints in AEM

Adobe Experience Manager (AEM) Content Fragment updates may not appear immediately on CDN-served Content API endpoints when cached responses remain valid until their TTL expires or the cache is explicitly invalidated. To resolve the issue, review the CDN cache settings, invalidate affected Content API endpoints after publication, and verify cache revalidation and updated content.

Description description

Environment

Adobe Experience Manager (AEM) (all versions)

Issue/Symptoms

  • After publishing or updating a Content Fragment in AEM, the corresponding CDN-served Content API endpoint returns outdated content.
  • The latest content is available when accessing the endpoint directly through the Dispatcher or origin, but not through the CDN.
  • The CDN cache configuration uses a defined TTL, for example, 1800 seconds (30 minutes), and doesn’t require revalidation.
  • No CDN cache purge or invalidation occurs after Content Fragment publication.

Root cause

The CDN continues to serve cached responses for Content API endpoints after Content Fragment publication because no CDN purge or invalidation is triggered and the configured TTL allows stale content to remain until expiry. Flushing the Dispatcher cache alone doesn’t clear the CDN cache.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the CDN caching configuration for Content API endpoints, for example, /content-api/*:

    • Confirm the TTL (max-age) for JSON responses.
    • Confirm the mustRevalidate setting.
  2. Assess the content freshness requirements. If Content Fragment updates must appear immediately after publication, consider reducing the TTL or enabling revalidation in the CDN configuration.

  3. Implement targeted CDN cache invalidation or purge:

    • After publishing a Content Fragment, trigger a targeted CDN purge or invalidation for the affected Content API endpoints.
    • Refer to the CDN control panel or API documentation for instructions on purging or invalidating specific URLs.
  4. Verify ETag and Last-Modifiedheader handling:

    • Ensure that the CDN is configured to respect origin ETag and Last-Modified headers for cache revalidation.
    • Confirm that new ETag values are generated when content changes.
  5. Test the end-to-end cache behavior:

    • Publish a Content Fragment and verify that the CDN returns the updated content and ETag after a cache purge or invalidation.
    • If stale content persists, review the CDN cache rules and consult the CDN documentation or support for advanced invalidation strategies.
recommendation-more-help
experience-cloud-kcs-help-kbarticles