Varnish 2.1: I'm trying to use http PURGE to get Varnish to renew one cached URL.
While testing, I would get results that seemed strange until I read this bit in the documentation: "If there are several variants of the same URL in the cache however, only the matching variant will be purged. To purge a gzip variant of the same page the request would have to look like this:"
So now if I do these two commands:
curl -I http://example.com/my-url
curl -X PURGE http://example.com/my-url
I get back a 200 Purged response.
And if I do these two:
curl -I http://example.com/my-url -H "Accept-Encoding: gzip"
curl -X PURGE http://example.com/my-url -H "Accept-Encoding: gzip"
I also get a 200 Purged.
Now if I try:
curl -I http://example.com/my-url -H "Accept-Encoding: deflate"
I get back headers that indicate that the Content-Encoding: is "text/html;charset=utf-8", and it has age in the cache. That seems to indicate that "deflate" isn't being supported by my app, which is probably correct.
The page also has an Age: header indicating that it's being cached.
Now how do I purge that? (Am I asking a moot question?)
All of these attempts return "404 Not in cache":
curl -X PURGE http://example.com/my-url -H "Accept-Encoding: deflate"
curl -X PURGE http://example.com/my-url -H "Accept-Encoding: text/html;charset=utf-8"
curl -X PURGE http://example.com/my-url -H "Accept-Encoding: text/html"
Is there a magic way to purge all of the variants of a URL?
vlc_hit
andvlc_miss
? – favoretticurl -I http://example.com/my-url -H "Accept-Encoding: gzip"
, followed bycurl -X PURGE http://example.com/my-url
? I'm not sure why it doesn't work in your example, other than response cached wasn't a page, but from what I understand, just purging a url should purge all instances of it. That being said, my varnish experience is rather non-extensive. – favoretti