Yikes, that's really disappointing.

Yikes, that's really disappointing. Thanks for the info. I'm coming to the realisation that CF is only really beneficial for very high traffic sites -- I wonder if all CDNs are as quick to evict cache entries.
27 Replies
Chaika
Chaika5mo ago
is CF specifically that quick to evict? I don't think they are, could vary a bit with the colocation center you are connecting to though/might be seeing the result of a multi-colo pop where each colo has different cache
Chaika
Chaika5mo ago
this asset has only got a handful of requests over the last 24 hours
No description
Chaika
Chaika5mo ago
but still firmly in cache
No description
Chaika
Chaika5mo ago
that's what, 18 hours cache age and it didn't even have requests for the last ~6 hours no tiered caching or anything enabled on that hostname
Rich
Rich5mo ago
I wonder if it's less likey to evict js or perhaps the file size is v. small? We cache a bunch of API requests to origin with the Cache API and often see a miss if left for 10mins or so
Chaika
Chaika5mo ago
I wonder if it's less likey to evict js or perhaps the file size is v. small?
Maybe, the only bit that I know was clarified to us was that - Cache is based on Access Frequency - Cache does not care about zone plan It depends a bit too on how exactly you are measuring it Cache API is local colo only, some PoPs like EWR are actually like ~5 colos in one, all with their own cache, and you have no specific affinity to one besides for keepalive
Rich
Rich5mo ago
Yeah this is why I want to get tiered caching, as it seems we don't have enough traffic to prime all the individual colo caches. tbh I don't have great visibility into the cache because the cache keys we use are pretty obfusicated (POST body hashes) similar to this https://developers.cloudflare.com/workers/examples/cache-post-request/ I'm not even sure Cache API entries are shown in the cache performance graph
Chaika
Chaika5mo ago
the one in the dashboard "Cache Analytics" excludes them The caching overview filters requests to only show ones made by eyeballs/actual users, via the "requestSource" There's edgeWorkerFetch and edgeWorkerCacheAPI which workers fall under could view them via graphql still
Rich
Rich5mo ago
ah nice, will take a look thanks
Chaika
Chaika5mo ago
{
"httpRequestsAdaptiveGroups": [
{
"count": 26361,
"dimensions": {
"cacheStatus": "none",
"requestSource": "purge"
}
},
{
"count": 449461,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "eyeball"
}
},
{
"count": 20999,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 6,
"dimensions": {
"cacheStatus": "stale",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 19,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "imageResizing"
}
},
{
"count": 1109768,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 821635,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "eyeball"
}
},
{
"count": 8234,
"dimensions": {
"cacheStatus": "dynamic",
"requestSource": "eyeball"
}
},
{
"count": 16,
"dimensions": {
"cacheStatus": "stale",
"requestSource": "eyeball"
}
},
{
"count": 368,
"dimensions": {
"cacheStatus": "revalidated",
"requestSource": "eyeball"
}
},
{
"count": 280,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 33140872,
"dimensions": {
"cacheStatus": "none",
"requestSource": "eyeball"
}
},
{
"count": 7592,
"dimensions": {
"cacheStatus": "none",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 1725937,
"dimensions": {
"cacheStatus": "dynamic",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 1773386,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 8,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "imageResizing"
}
},
{
"count": 7113,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 25303,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 2618914,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "eyeball"
}
},
{
"count": 60514,
"dimensions": {
"cacheStatus": "none",
"requestSource": "edgeWorkerFetch"
}
}
{
"httpRequestsAdaptiveGroups": [
{
"count": 26361,
"dimensions": {
"cacheStatus": "none",
"requestSource": "purge"
}
},
{
"count": 449461,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "eyeball"
}
},
{
"count": 20999,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 6,
"dimensions": {
"cacheStatus": "stale",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 19,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "imageResizing"
}
},
{
"count": 1109768,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 821635,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "eyeball"
}
},
{
"count": 8234,
"dimensions": {
"cacheStatus": "dynamic",
"requestSource": "eyeball"
}
},
{
"count": 16,
"dimensions": {
"cacheStatus": "stale",
"requestSource": "eyeball"
}
},
{
"count": 368,
"dimensions": {
"cacheStatus": "revalidated",
"requestSource": "eyeball"
}
},
{
"count": 280,
"dimensions": {
"cacheStatus": "miss",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 33140872,
"dimensions": {
"cacheStatus": "none",
"requestSource": "eyeball"
}
},
{
"count": 7592,
"dimensions": {
"cacheStatus": "none",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 1725937,
"dimensions": {
"cacheStatus": "dynamic",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 1773386,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "edgeWorkerFetch"
}
},
{
"count": 8,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "imageResizing"
}
},
{
"count": 7113,
"dimensions": {
"cacheStatus": "expired",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 25303,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "edgeWorkerCacheAPI"
}
},
{
"count": 2618914,
"dimensions": {
"cacheStatus": "hit",
"requestSource": "eyeball"
}
},
{
"count": 60514,
"dimensions": {
"cacheStatus": "none",
"requestSource": "edgeWorkerFetch"
}
}
yea there's a whole bunch of types and again only the cache analytics shows "eyeball" { "count": 25303, "dimensions": { "cacheStatus": "hit", "requestSource": "edgeWorkerCacheAPI" } vs other types (miss/expired/stale) would probably be what you'd be after
Rich
Rich5mo ago
cool, I'm going to try and shove that into a graph to see if the cache really is as ineffective for us as I think it is 👍 weirdly, I don't see any edgeWorkerCacheAPI sources in my zone 🤔 plenty of edgeWorkerFetch though -- even though we don't use the fetch caching
Chaika
Chaika5mo ago
that'd appear if you are fetching out at all though, caching or not hmm and you're using cache api on a worker attached to that zone? Pages Functions would always be executing in the context of the pages.dev, for example
Rich
Rich5mo ago
ah ok, I suppose it still potentially caches responaes if the origin headers allow it -- regardless of passing cf cache ttl fetch('foo', { cf: { cacheTtl: 5 } })?
Chaika
Chaika5mo ago
those are just overrides yea, you still go through the normal cdn/cache rules/etc
This option forces Cloudflare to cache the response for this request, regardless of what headers are seen on the response. This is equivalent to setting two Page Rules: Edge Cache TTL and Cache Level (to Cache Everything). The value must be zero or a positive number. A value of 0 indicates that the cache asset expires immediately. This option applies to GET and HEAD request methods only.
https://developers.cloudflare.com/workers/runtime-apis/request/#the-cf-property-requestinitcfproperties
Rich
Rich5mo ago
our "zone" is configured as a custom domain on the worker in question so I'm assuming that means analytics would come under our zone, rathert than pages .dev (we are using CF Pages)
Want results from more Discord servers?
Add your server