Our setup is static files like images, txt, json, video are stored in AWS S3 buckets. We then have cloudfront distributions in front of these buckets with cnames tied to certs provided by Cloudflare. We then have cloudflare DNS pointing to these cloudfront distributions. We also have page rules with “Cache Level: Cache Everything, Edge Cache TTL: a month” with the url “OurWebSite/”.
The issue is when inspecting files everything looks good except we show in the response headers the following (removed some lines to show issue):
via:1.1 5eb275fcc12eed81d31710e5eed4b529.cloudfront.net (CloudFront)
x-cache: Hit from cloudfront
It looks like both cloudflare shows a hit but then passes on the cloudfront which shows a hit. This matches up with logs in cloudfront and our AWS bill which shows dramatic cloudfront usage. I verified one .json file here: https://cf-cache-status.net/ and it showed a hit. I found this topic “inexplicable-caching-of-content-type” (can’t post link due to being new user) which was resolved by purging all of cloudfront cache but that did not resolve our issue.