0

Sorry if I wasn't able to find the relevant doc on this: how does Squid 4 compute a given GET request's cache key? Is there a way to instruct to ignore HTTP headers in how it does this, i.e. only use the URL?

Long story short, I would need Squid to cache (and serve cached answers) purely based on the URL, and ignoring in particular Authorization headers (but still use that header if it needs to hit the upstream servers).

(and yes, I understand how serving cached content regardless of the provided auth header is generally a bad idea, but it's fine for my use case).

Thanks!

user4867444
  • 445
  • 4
  • 5

1 Answers1

0

The key is the store_id_program, which is a program squid calls to convert the URL's into a cache key. Otherwise the URL us used as is.

This is one example, using just the 'RPM filename' as the key. https://github.com/yevmel/squid-rpm-cache

However my problem is that squid only caches HTTP requests, and not HTTPS requests, which just about everything uses these days, even when it isn't necessary.

To solve that requires something called 'ssl_bumping' which I am still figuring out... https://wiki.squid-cache.org/ConfigExamples/Intercept/SslBumpExplicit https://rasika90.medium.com/how-i-saved-tons-of-gbs-with-https-caching-41550b4ada8a

NOTE successful as yet but I'm working on it.

anthony
  • 329
  • 2
  • 8