Respect Existing Headers + no cache headers sent from origin


#1

Hi,

If “Browser Cache Expiration” is set to “Respect Existing Headers”, and the origin is not sending any cache-related headers, when will Cloudflare cache files?

We need to implement Webpack (so that file names change when content changes), and configure our servers for long-duration caching, but before that work can be completed, we’d like the caching behaviour to remain as it is (from my understanding, browsers use a certain algorithm to decide whether or not to load a file from cache in the absence of cache control headers).

I get the feeling that CF is still caching files though, even without these headers. If I want to retain the existing behaviour, do I need to add a custom page rule to disable all caching?

Thanks,

Glen.


Cache-Control headers from origin not being respected for POST requests
#2

You can check to see if an object is being cached by Cloudflare

curl -I https://your.site/path/to/image.jpg and look for cf-cache-status.


#3

I know how to do that, but that doesn’t answer my question. :slightly_smiling_face:

When there is no Cache-Control header, what does Cloudflare use to determine whether or not to re-request the file from the origin server?

Thanks.


#4

Cloudflare isn’t a browser, so it’s cache settings as a CDN will be different than what the “browser cache expiration” setting is. But you’ve instructed Cloudflare to continue to pass whatever headers you are or aren’t setting ot the client so that behavior should remain the same. If you don’t want Cloudflare to cache content or want it to cache content differently than it does by default see the link below.


#5

Thanks for the link.

So if I understand correctly, without the cache-control header, Cloudflare will cache all (or most) of the time, and the way to control that is with Page Rules?