- Newest
- Most votes
- Most comments
Since you are using the CachingOptimized Cache Policy, your cache key is restricted exclusively to the URL path. Your All Viewer Origin Request Policy forwards all data to the origin upon a miss, but in the modern CloudFront policy system, it does not alter the cache key or disable caching on its own.
If you are experiencing a 100% Cache Miss rate on your default behavior, to me, the root cause is almost certainly your Origin (Bluehost/WordPress) returning HTTP response headers that explicitly instruct CloudFront not to cache the object.
Specifically, CloudFront will not cache the response if your origin returns:
Cache-Controldirectives such asno-cache,no-store,private, ormax-age=0- A
Set-Cookieheader
By default, CloudFront respects the origin's Cache-Control directives. You can easily verify this by running curl -I [https://pfa.mihaiadam.com/pricing/](https://pfa.mihaiadam.com/pricing/) in your terminal and inspecting the response headers.
How to fix it:
Either adjust the Cache-Control headers directly at your Bluehost origin, or create a Custom Cache Policy in CloudFront where you set the Minimum TTL to a value greater than 0. Setting a Minimum TTL > 0 forces CloudFront to cache the object and override the origin's restrictive headers.
References:
- AWS Documentation: How CloudFront processes and caches based on Cache-Control headers
- AWS Documentation: Controlling the cache key
Based on your configuration, there are a few factors that could be causing cache misses with the CachingOptimized policy:
Understanding the Cache Key with CachingOptimized
While CachingOptimized does focus on the URL path as a primary cache key component, it's not the only factor. The cache policy determines which values CloudFront includes in the cache key, which can include HTTP headers, cookies, and URL query strings. CloudFront uses this cache key to find matching objects in its cache.
The Impact of "All Viewer" Origin Request Policy
Your use of the "All Viewer" origin request policy is likely a significant contributor to your cache miss issue. When you configure CloudFront to forward all headers to your origin (which "All Viewer" does), CloudFront doesn't effectively cache the objects associated with this cache behavior. Instead, it sends every request to the origin, resulting in consistent cache misses.
Recommended Solution
To improve caching, you should switch from the "All Viewer" origin request policy to a more restrictive policy that only forwards the headers your origin actually needs. The headers, cookies, and query strings included in the cache key are automatically included in requests to the origin, so you don't need to forward everything.
If you need to send certain values to the origin but don't want them affecting your cache key, you can use a separate origin request policy to specify those additional headers without impacting caching behavior.
Additional Considerations
Keep in mind that caching based on too many headers can affect performance by causing more requests to be forwarded to the origin for the same object. If your origin returns the same content regardless of certain header values, you shouldn't configure CloudFront to cache based on those headers.
Unfortunately, CloudFront doesn't provide a direct way to log the exact cache keys being generated, but understanding which headers, cookies, and query strings are included in your cache policy will help you determine what's being used for cache key generation.
Sources
Cache content based on request headers - Amazon CloudFront
CachePolicy - Amazon CloudFront

Thank you for your answer, The Cache-Control was as you expected, and after a Custom Cache Policy in CloudFront, the page cache works !