Varnish 2.1 made req.hash unreadable / does not store it. So purge.hash will no longer work.
Getting hash output back
sub vcl_hash{ set req.http.X-Hash = req.http.host; ... more stuff ... set req.http.X-Hash = req.http.X-Hash "#"; # add trailing '#' to be compatible to varnish 2.0 set req.hash += req.http.X-Hash; # store in unreadable req.hash return(hash); } sub vcl_deliver { ... more stuff ... # store hash in response for matching / testing that hashing works set resp.http.X-Hash = req.http.X-Hash; return (deliver); }
Purging on hash
varnishadm -T 127.0.0.1:6082 'purge req.http.X-Hash ~ something'