How to purge Fastly CDN cache in Adobe Experience Manager Sites to restore redirect behavior
This article explains how to resolve issues where expected redirects in Adobe Experience Manager (AEM) Sites don’t occur because of cached content in the Fastly CDN, by purging the cache for the affected URL.
Description description
When using Adobe Experience Manager (AEM) Sites with Fastly CDN, updates to redirect logic don’t take effect immediately if the previous response is cached. This results in URLs continuing to serve outdated content instead of performing the intended redirect, potentially increasing traffic and licensing usage.
Environment
- Adobe Experience Manager (AEM) Sites (all versions)
- Fastly CDN integrated with AEM as the content delivery network
Symptoms
- A specific URL is expected to redirect to another destination, but continues to serve cached content after a fix is deployed.
- Increased traffic and licensing consumption is observed.
- Header checks (For example: using curl) show that the response is served from cache and the redirect doesn’t occur.
Cause
Cached content in Fastly CDN prevents the updated redirect logic from being served until the cache is purged.
Resolution resolution
Follow the steps below to resolve the issue:
-
Identify the affected URL that isn’t redirecting as expected (For example: https://www.example.com/apps/linktest).
-
Ensure you have the necessary permissions and access to purge the Fastly CDN cache for your AEM environment.
-
Obtain your Fastly CDN purge credentials. If you don’t have these, refer to your organization’s AEM administrator or follow your internal process for obtaining CDN credentials.
-
Purge the Fastly CDN cache for the specific URL using a command such as:
code language-none curl -X PURGE "https://www.example.com/apps/linktest" \ -H 'X-AEM-Purge-Key: ' \ -H 'X-AEM-Purge: soft'Replace with your actual purge key.
-
Verify the purge by running a header check:
code language-none curl -sI "https://www.example.com/apps/linktest" | grep -iE '(date|age|x-cache|x-served-by|expires):'Look for
x-cache: MISSin the response headers and confirm that the redirect now works as intended. -
Monitor your traffic and licensing usage to ensure they return to expected levels.