Different Cache 'Age' for same file, from different browsers/incognito

I’m using the Cache API inside worker to cache HTML pages.

It works well, however, when I visit the same page from Incognito or a different browser, it’s getting either “EXPIRED” or a different cache is generated.

Does Cache API somehow identify “browser” and generate a different cache key? From reading the docs, the key is the URL that we’ve given.

Also, notice the “Age” in response headers (screenshot attached), the time since cached is entirely different (bot pages opened at the same time). cf-ray says it’s delivered from the Pop “SIN”.

The worker script is from the examples, but with modified cache TTL to 1 month.

1 Like

My typical guess on this is that you’re hitting a different edge server, as they tend to have different caches. As an experiment, I just hit one of my domains: example.com/cdn-cgi/trace and the first line (fl=something) changed after the first try, then stayed the same after that).

@sdayman you’re right I guess. It’s giving different “f1” from the trace. Looks like there are too many clusters in the same region. I thought they share the cache.

Tiered Caching would share the same upstream cache, though you may still get differing ages from different edge servers.

https://developers.cloudflare.com/cache/about/tiered-cache/