Some cache use cases i would like to share

i’m the developer of an open-source cache solution, “upcache”.
The idea is to let the upstream application pass HTTP headers hints back to the caching proxy, in a similar way to Vary and Cache-Control directives, but with additional protocols between caching proxy and upstream, covering those use cases:

  • grouping urls together using a cache “domain” (key, tag, you name it) and any non-GET(or HEAD) request invalidates the urls bound to that domain
  • grouping trusted jwt permissions (using rsa pub/priv) to cache urls by permissions (and not by account) on top of “domain” keys - grouping each authenticated user with all the other users using the same permissions
  • mapping an url to another url, to avoid cache variants to fill the cache. This is useful for 404 pages, or redirected pages.

I’m currently using those concepts without Cloudflare, implementing it with nginx/lua and upstream nodejs applications. And i think Cloudflare should implement it.

Some references:

i know it’s not on anyone’s agenda but it really adresses a common problem with caching proxies and upstream applications in a very neat way !

I think Fastly implements this. Cloudflare’s APO service (which is only for Wordpress right now) might already implement this, but no, it’s not in Cloudflare itself.

Neat idea.

Also a neat idea. You can already do this if you use rewrite rules craftily though.

Caching by keys is an Enterprise feature. APO’s purge is usually a purge by URL list generated by WordPress.

I’m not quite clear on the Cache by Token. Does this mean some user gets to determine which resources are cached? If you want selective caching, you can add special cache headers at the origin.

I stand corrected. I’d sort of blocked any Enterprise-only features out of my mind, as they are unavailable to mere mortals.

1 Like

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