Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: => this will cache successfully => this won't cache.

Does anyone know why and how to fix that?

share|improve this question
up vote 8 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
It changed in version 2.7 (2008), now squid does cache by default resources with query string : – iwalktheline Jan 26 '15 at 10:42

Your Answer


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.