Is it possible to have different cache volumes?

Hi!,

I wanted to ask to see if it is possible with Cloudflare to have 2 or more “buckets” or “volumes” where things/responses are cached and they don’t affect each other in terms of evicting elements from the cache.

Here is my scenario and its properties:

  • Every URL is meant to be cached forever.
  • Index.json responses takes ~10s to construct at server side, small in size (~1-10KB)
  • Asset responses takes ~1s to construct at server side, big in sizes (~1-10MB)
  • One index.json can reference 100+ asset files.

What ends up happening is that the cache can evict index.json from the cache because not enough space, which will make that the next index.json request is not in the cache and the server will spend ~10s constructing that index.json again which will cascade to all the assets referenced in that index.json to take ~10s for its response.

We solved this issue in other caches by having two volumes, where index.json and assets are cached in separate spaces and the size/space used by one group does not affect the other.

Do you know if this type of behavior is possible to be achieved with Cloudflare with some type of rule, or there is a place to define “quotas” or “volumes” for certain types of URLs ?

Thanks a lot for your help and time :smiley:

Llorenç

CDN cache eviction will always happen at one point or another, with lower plans assets likely to be evicted first.

It sounds like you’re looking for the Cache Reserve product which is a “permacache” backed by R2 and you can set it to only revalidate after a certain period of time with the Cache-Control max-age directive.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.