Cache key - response vs plain text

What are the main differences between constructing the cache key with a response object vs using just the URL?
What request headers are part of the key? Does different user agent string results in a different cache key?


If I have to guess I’d say lots of headers, like

  • Content-Encoding
  • Content-Type (super important in case of multipart boundary generated per request)
  • Accept
  • Authorization

Just using the url is OK if you don’t mind those kind of headers, for example if you have only anonymous GET requests with always the same exchange format

Makes sense.
I see different cache served when I use different browsers, trying to figure why.