Cache Busting URL’s with querystring params?

There is a LOT of noise and discussion about this online, most often attributed to the following source,
http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

While it was relevant back when this was written in 2008, but the main reason cited was proxy server behavior, particularly Squid Proxy. FWIW, Squid had this capability before, but it was not the default setting. They changed their default policy with caching dynamic URLs with their 2.7 release, stable since 31 May 2008.

http://wiki.squid-cache.org/ConfigExamples/DynamicContent

Outline: The obsolete default configuration of squid prevents the caching of dynamic content (pages with ? in the URI), like so:


hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY

NOTE: That policy setting was created at a time when dynamic pages rarely contained proper Cache-Controls, that has now changed. From the release of Squid 2.7 and 3.1 the squid developers are advocating a change to this caching policy. These changes will also work in 3.0 and 2.6 releases despite not being officially changed for their squid.conf.default.

The changed policy is to remove the QUERY ACL and paired cache line. To be replaced by the refresh_patterns below:


refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

Squid Release history, for reference.

Version First STABLE release Date Latest Release Latest Release Date

3.5   Jan 2015
3.4	09 Dec 2013	3.4.12 	 18 Feb 2015 
3.3	09 Feb 2013	3.3.13 	 28 Aug 2014 
3.2	14 Aug 2012	3.2.13 	 13 Jul 2013 
3.1	29 Mar 2010	3.1.23 	 09 Jan 2013 
3.0	13 Dec 2007	STABLE26 28 Aug 2011 
2.7	31 May 2008	STABLE9 16 Mar 2010 
2.6		01 Jul 2006 	STABLE23 17 Sep 2009 
2.5		25 Sep 2002 	STABLE14 20 May 2006 
2.4		20 Mar 2001 	STABLE7 02 Jul 2002 

NOTE: if you would like to verify how widespread QueryString versioning is, please look at the source of microsoft.com or just about any WordPress powered website.

REFERENCES:

Leave a Reply