Custom cache key

Hello,

how can I configure the cache key so that 2 different URLs https://test.com/test/abc and https://test.com/test/def have the same cache key, please?

Thank you.

I believe the only way would be with a Worker:

https://developers.cloudflare.com/workers/examples/cache-using-fetch/

Otherwise, the path itself is hard-coded as part of the cache key.

Or…since it sounds like they’re the same resource, use a URL Rewrite to write one to the other:

https://developers.cloudflare.com/rules/transform/url-rewrite/

1 Like

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