On 28.12.2011 15:12, Lars Jørgensen wrote: > I'm stumped on how to extract the original url from that request, > though.
regsub(str, regex, sub)
Returns a copy of str with the first occurrence of the regular
expression regex replaced with sub. Within sub, 0 (which can also
be spelled &) is replaced with the entire matched string, and n is
replaced with the contents of subgroup n in the matched string.
https://www.varnish-cache.org/docs/3.0/reference/vcl.html#functions
i.e. something like this should work:
set req.url = regsub(req.url, "\$PURGE$", "");
> As a workaround, I would like to enable CMS editors to call content with a
> postfixed string to purge it. Like this: www.website.com/index.html$PURGE
I use a special request header to force a cache miss and retrieve
updated content from the backend:
if (req.http.X-FreshForce == "yes") {
# Force a cache miss
set req.hash_always_miss = true;
}
CMS editors have a button in their browsers to enable the X-FreshForce
header, e.g. by using http://www.garethhunt.com/modifyheaders/ or similar.
Hauke
signature.asc
Description: OpenPGP digital signature
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
