We’re using Cloudflare in front of a CloudFront distribution that serves static assets (mainly .png and .jpg images) from an S3 bucket. These are requested from the media. subdomain, which has a CNAME record pointing to the CloudFront distribution domain. The assets return correct Cache-Control headers (max-age=2678400), and CloudFront responds with x-cache: Hit from cloudfront, confirming they’re cached at that layer. However, Cloudflare consistently returns cf-cache-status: MISS. We’ve tested with no cookies, no query strings, and standard content types (image/png, image/jpeg). We’ve also tried applying cache rules in Cloudflare based on file extension and hostname, but the assets still aren’t being cached. We’re trying to understand why Cloudflare is skipping cache and what adjustments are needed to get reliable edge caching for these static images.
And just to confirm, you don’t have a cache rule that limits the Edge TTL to a few seconds? I see that the image is cached for a very short time, before it’s seemingly purged again after ~2 seconds.
Can you share your other Cache settings as well? I’m trying to reproduce the issue, but so far everything works for me.
Would you also share your server’s Cloudfront address with me via a private message so I can check what headers your server sends and which are added by Cloudflare?