Repeat Visitors When Cache Everything Enabled

Say a URL requires only two requests when loaded, and cache everything (with 1 year expiry for browser data) is enabled.

If I visit the URL 30 times, will 60 requests be recorded or just 1?

Does the stat counter record all requests regardless of whether they’re repeat and served through CF cache?

Thank you, thank you, thank you…

With caching things rarely are black and white, so take all that with a grain of salt.

In theory you will have exactly two requests for the two resources in this scenario. All following requests should go first to the browser cache and subsequently to Cloudflare’s cache. Here’s now where we discover the salt mine :wink:

First, as long as the browser caches it (for mentioned year) subsequent requestd should be local-only however there is no guarantee for that and the user can always force a refresh.

This leads us to the second part, Cloudflare’s cache. Once the browser sends a request it will hit Cloudflare and Cloudflare will serve the file from it cache, if it is still there. You didnt specify how long you set the caching duration on Cloudflare, but even if you set it to its maximum of a month, you wont have a guarantee it really will be cached for that long as Cloudflare does reserve the right to purge files, especially those which are accessed less frequently.

Of course this latter description only applies for requests going through the same Cloudflare datacentre. All locations/datacentres cache your resources individually.

The counter on Cloudflare? Yes that will also count requests which were served from Cloudflare’s cache, not however requests which the browser still had cached.

2 Likes

Set to expire after a month.

Thanks for the answer. So basically, it’s complicated is what it is.

In that case Cloudflare will keep the data for a maximum of up to a month but might remove it earlier, particularly if it is not frequently accessed.

Yes, caching is always a bit complicated. Caching and string parsing - whom am I kidding, all that IT stuff :smile:

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