Understanding Cache

I am confused. When I first started using Cloudflare caching, I thought that a copy of the site would be stored on a Cloudflare server and that I could specify how long it would remain unchanged before it would refresh itself by getting a new copy from the site’s hosting web server. When I came to reset this for one of my sites, I noticed that the duration refers to “browser cache”. When I read that term, I imagine that it refers to the cache maintained by browsers such as Chrome or Safari. Is this setting referring to the browser app’s cache or is it referring to the Cloudflare cache? I can’t really see how it can refer to the browser app’s cache, but I am confused.

I want to use the Cloudflare cache to make sure that users are seeing an old version of the site while it undergoes major changes. Is that possible?

Sorry if I am being stupid; I am new to all this.

Cloudflare by default respects the Cache-Control Headers of your site.
So a Header like below, will not cache:

Cache-Control: max-age=0

Cache-Control: max-age=0, must-revalidate

No, that’s not something to count on. Regardless of your cache setting, you can’t force all of Cloudflare to show a cached version of your site. Unused data gets purged before expiration. Every Cloudflare datacenter has its own independent cache.

If you want to remodel a site, you need to do it in a staging area before you push it into production.

1 Like

You can’t use Cloudflare as an hosting provider without one actually sitting behind it from where to fetch the content. They don’t guarantee persistence in the cache in every POP, especially if the traffic is low, even if you set year long expiration dates on the calendar resources.

1 Like

There a possibility with Cloudflare, you need to build a Worker with KV.
Use the url for key and value the server response.

This topic was automatically closed after 31 days. New replies are no longer allowed.