Skill 5.3.3
Identify and remediate CloudFront caching issues
Key Concepts
Stale content after a deployment comes from TTLs; fix it with an invalidation of the changed paths or, better, versioned file names. A low cache hit ratio comes from cache keys that include unnecessary headers, cookies or query strings, or from origins sending Cache-Control: no-cache or private; tune the cache policy and origin headers. Wrong content (for example another language or device version) comes from a cache key that omits a value the origin varies on.
Use the CloudFront cache statistics and popular objects reports, the CacheHitRate metric (with additional metrics enabled) and the x-cache response header (Hit from cloudfront or Miss from cloudfront) to verify fixes. Origin Shield increases hit ratio for origins with global traffic.