Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

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.

share|improve this answer
add comment

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 ?.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.