Disable Fastly CDN caching in AEM as a Cloud Service
Fastly is always part of the content delivery path in AEM as a Cloud Service and cannot be removed. Unexpected caching occurs whenCache-Control or Surrogate-Control headers are missing, overridden, or inconsistently applied across resources. In environments that use a customer-managed CDN, incorrect forwarding headers can also affect cache behavior and redirect handling.
To resolve the issue, configure cache-control headers correctly, validate CDN settings, and verify Fastly pass-through behavior.
Description description
Environment
- Adobe Experience Manager as a Cloud Service (AEMaaCS)
- Bring Your Own CDN (BYOCDN) deployments
- Dispatcher configurations
- CDN configuration using
cdn.yaml
Issue/Symptoms
- Fastly
x-cacheheader shows MISS or SYNTH when cache bypass is expected. - Fastly caches specific file types despite configured cache-control headers.
Surrogate-ControlorSurrogate-Keyheaders don’t appear at the edge.- Personalized content displays inconsistent behavior because cached fragments are reused.
- Unexpected redirects occur when requests pass through multiple CDN layers.
Cause
Fastly is an integral component of the Adobe Experience Manager as a Cloud Service delivery architecture and remains in the request path at all times. Fastly caches content when Cache-Control or Surrogate-Control headers are missing, incomplete, overridden, or applied inconsistently across resource types. Some asset types, such as.vtt files, require explicit cache-control rules. In BYOCDN deployments, incorrect X-Forwarded-Host orX-Forwarded-Protoheaders can create different cache keys, resulting in unexpected caching or redirect behavior.
Resolution resolution
Follow these steps to resolve the issue
- Review the response headers and verify that
Cache-ControlandSurrogate-Controlappears on affected responses. - Confirm that
Surrogate-Controlcontains values such as max-age=0 or no-store that prevent Fastly caching. - Update the Dispatcher virtual host configuration so that
Cache-ControlandSurrogate-Controlheaders are applied consistently across HTML, JSON, assets, and other resource types. Add explicit rules for resource types that don’t inherit the required headers. - Verify that the customer-managed CDN doesn’t override Fastly cache-control directives.
- Review CDN logs and confirm that the customer-managed CDN performs caching while Fastly operates in pass-through mode.
- Configure cache bypass in
cdn.yamlif header-based controls don’t achieve the expected behavior. Deploy the updated configuration through Cloud Manager and verify that deployment completes successfully. - Validate multi-CDN routing by confirming that the original
Hostheader andX-Forwarded-Protoheader are forwarded correctly throughout the CDN chain. - Review fragment caching implementations and ensure that personalized fragments aren’t cached.
- Verify that dynamic responses return the appropriate non-cacheable headers.
- Configure
Surrogate-Keyheaders when purge workflows rely on key-based invalidation. - Enable Fastly debugging and verify that surrogate keys appear in the response headers.
- Validate the final configuration by confirming that Fastly returns PASS, that the customer-managed CDN caches as expected, and that cache purge operations behave correctly.