1

Do most popular proxy servers cache the response data based on the Uri? Also, lets exclude HTTP Headers like Cache-Control, etc... and assume they have been set to public, max-age: xxxx s-maxage: yyyyy etc...

So .. assuming the proxy server says 'this resource needs to be cached' .. what is the 'key'? the Uri?

so if i have

  • www.somedomain.com
  • www.somedomain.com/foo
  • www.somedomain.com/foo?
  • www.somedomain.com/foo?a=1
  • www.somedomain.com/foo?a=1&b=2

they are all separate cached items?

Pure.Krome
  • 6,508
  • 18
  • 73
  • 87

3 Answers3

0

My understanding is that most commonly it's a hash of things related to the URL, such as the name/address of the host, path, and sometimes other options such as cgi args. According to this FAQ, Squid uses a hash of straight URL and the HTTP retrieval method to identify items already in the cache.

I think that the URLs you've listed would indeed cause separate cache items to be created in most cases.

nedm
  • 5,630
  • 5
  • 32
  • 52
0

I'm familiar with Squid. It definitely caches all your example URIs as separate objects. But please note that it's perfectly possible to configure Squid to not cache URIs matching certain pattern, such as those containing ?.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
0

The URL is definitely a key parameter when it comes to caching. In fact speaking as a web developer, one way to prevent caching of web resources is to append a random query string to the end of the URL.

yaser
  • 95
  • 2
  • 8