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

I'm having an issue here.
i setup my router with squid transparent proxy and also to do static files caching.
It can cache static files successfully. But it cannot cache static file with query string. Example: http://www.example.com/style.css => this will cache successfully
http://www.example.com/style.css?v=1.1 => this won't cache.

Does anyone know why and how to fix that?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

The default configuration of Squid is to not cache dynamic content (which URLs with query strings are considered to be). That Squid wiki page explains how to change this. Basically you need to remove the following line from squid.conf:

cache deny QUERY

and replace it with these refresh patterns:

refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern .            0 20% 4320
share|improve this answer
1  
It changed in version 2.7 (2008), now squid does cache by default resources with query string : wiki.squid-cache.org/ConfigExamples/DynamicContent –  iwalktheline Jan 26 at 10:42

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.