CDN cache MISS at each POP for same image URL
This article describes why images served by a servlet in Adobe Experience Manager as a Cloud Service may result in CDN cache MISSes at different CDN Points of Presence (POPs), even when cache-control headers specify a 24-hour TTL, and provides guidance on expected CDN caching behavior.
Description description
Environment
Adobe Experience Manager as a Cloud Service (all versions)
Issue/Symptoms
A servlet returns JPEG images for store pages and sets a Cache-Control: max-age=86400 header (24 hours). However, CDN logs show that the same image URL is fetched multiple times from the Publish instance within a day, with cache status MISS at different CDN locations (POPs).
Example log entries:
- Cache MISS at POP “RTM” for
/path/sample.jpg - Cache MISS at POP “TOJ” for
/path/sample.jpg
The expectation is that the image is cached and served from the CDN for 24 hours after the first request, regardless of the POP. Instead, each POP experiences a cache MISS on its first request for the image.
Cause
Each CDN POP operates its own cache. The first request for a resource at each POP results in a MISS, and only subsequent requests from that POP are served from cache until the TTL expires.
Resolution resolution
To fix the issue, follow these steps:
- Understand that each CDN POP maintains its own cache. The first request for a given URL at each POP will result in a cache MISS; subsequent requests from that same POP (while TTL is valid) will be a cache HIT.
- Ensure the servlet sets explicit cache headers for both browser and CDN. Use
Cache-Control: max-age=86400, publicand consider addingSurrogate-Controlors-maxagefor CDN-specific TTL if supported. - Avoid using
privateorno-storedirectives, as these prevent CDN caching. - Use tools such as
curland review CDN logs to confirm that the first request at each POP is a MISS and that subsequent requests from the same POP within the TTL are HITs.
For more details, see the AEM as a Cloud Service CDN caching documentation.