
contact at jpluscplusm
Apr 3, 2012, 10:39 AM
Post #3 of 3
(456 views)
Permalink
|
|
Re: How to ignore chars after question mark in URL?
[In reply to]
|
|
On 3 April 2012 15:25, Kurt Kraut <listas [at] kurtkraut> wrote: > Hi, > > I need to cache URLs of the same file but the front-end developer generates > a random string, e.g.: > > www.kurtkraut.net/index.css?234234432 > www.kurtkraut.net/index.css?654323256 > www.kurtkraut.net/index.css?905837831 > > How can I get a HIT for www.kurtkraut.net/index.css not matter the presence > or not of the question mark and the random string after the question mark? > Is it possible to ignore the presence of the question mark and the rest of > the URL? In my experience, developers often do this deliberately as a method of versioning their CSS and JS. They'll append a "random" string (often a unix timestamp) at deployment time, rendering that particular version of the resource cachable until the next deployment. Are you absolutely sure that this isn't what your devs are doing? Because if they are, you'd be doing *exactly* the wrong thing by explicitly ignoring the query-string, and may well break the application during a random deploy, sometime in the future. But possibly not during *each* deployment, leading to nicely intermittent bug reports depending on the amount each CSS/JS has changed, and the state of the user's browser cache :-) HTH, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html _______________________________________________ varnish-misc mailing list varnish-misc [at] varnish-cache https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
|