Purge large sets of cached AEM content when surrogate keys are missing
This article describes the available options for invalidating cached content in the Adobe Experience Manager as a Cloud Service CDN when previously cached objects lack the Surrogate-Key header and purging by path prefix is required.
Description description
Environment
- Adobe Experience Manager as a Cloud Service
- Adobe-managed CDN
- A large set of cached content whose older objects don’t have a
Surrogate-Keyheader
Issue/Symptoms
- After you update the cache configuration, older cached objects don’t have the new
Surrogate-Keyheader. - Purging by the new surrogate key doesn’t invalidate those older objects.
- You need to invalidate many URLs without clearing unrelated cached content.
- A full CDN purge is undesirable because it clears all cached resources.
Cause
Objects cached before the Surrogate-Key header was added don’t have that key and therefore can’t be purged as a group using the new key. The Adobe-managed CDN supports single-URL purge, surrogate-key purge, and full purge; it doesn’t support purging by path prefix or wildcard.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review the supported CDN purge methods:
- Single-URL purge invalidates one resource.
- Surrogate-key purge invalidates resources cached with the specified
Surrogate-Keyheader. - Full purge invalidates all cached resources.
- Path-prefix and wildcard purges aren’t supported.
-
Purge newly cached resources by surrogate key. For resources cached after the configuration change that have the new
Surrogate-Key, send one surrogate-key purge request with the appropriate headers. This invalidates all CDN objects with that key. -
For older cached objects that don’t have the surrogate key, choose one of the following options:
-
Option A: Send a soft purge for each URL.
- Generate a list of the affected URLs.
- Use a script to send an individual soft purge request for each URL.
- This targets the required content and avoids a full purge.
- Before purging, ensure the latest content is available on the Dispatcher or Publish tier. Otherwise, the CDN can cache outdated content again.
-
Option B: Perform a one-time full CDN purge.
- Use this option only if clearing all cached objects is acceptable.
- A full purge invalidates all cached content, not just the targeted pages.
- Expect a temporary increase in origin traffic while the cache refills.
-
Option C: Allow the previous cache TTLs to expire.
- This option requires no manual purge, but users might not see the updated content until the cached objects expire.
-
-
After purging or waiting for the TTLs to expire, open the affected URLs and confirm that they display the updated content.