View Single Post

  #1 (permalink)  
Old 04-19-2008
cseifert
 
Posts: n/a
Default squid doesnt use cache when URL has a param

Hi there, I configured my squid installation (2.6) to pretty much try
accessing pages always from the cache. This is working fine when I
access a page that does not contain any params on the URL, like
http://www.foo.com/test.html

The access log shows:
1208638403.776 608 192.168.77.2 TCP_MISS/200 5532 GET http://www.foo.com/test.html
- DIRECT/XXX.YYY.Z.18 text/html
1208638421.093 0 192.168.77.2 TCP_MEM_HIT/200 5566 GET
http://www.foo.com/test.html - NONE/- text/html

However, if the URL has a parameter, like http://www.foo.com/test.html?test,
this doesnt work anymore.

The access log shows:
1208638947.412 422 192.168.77.2 TCP_MISS/200 2792 GET
http://www.foo.com/test.html? - DIRECT/XXX.YYY.Z.18 text/html
1208638950.869 414 192.168.77.2 TCP_MISS/200 2792 GET
http://www.foo.com/test.html? - DIRECT/XXX.YYY.Z.18 text/html

I can imagine why Squid is behaving that way. If the param is passed
in, there is likely to be some processing on the server side returning
different content. HOwever, if the processing is deterministic, the
resulting page should be the same and therefore could be cached.

Is there a way to configure squid to behave like this?

Any insights would be greatly appreciated.

Thanks
Christian
Reply With Quote