Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make Varnish purge all variants of a URL?
    text
    copied!<p>Varnish 2.1: I'm trying to use http PURGE to get Varnish to renew one cached URL.</p> <p>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:"</p> <p>So now if I do these two commands:</p> <pre><code>curl -I http://example.com/my-url curl -X PURGE http://example.com/my-url </code></pre> <p>I get back a 200 Purged response.</p> <p>And if I do these two:</p> <pre><code>curl -I http://example.com/my-url -H "Accept-Encoding: gzip" curl -X PURGE http://example.com/my-url -H "Accept-Encoding: gzip" </code></pre> <p>I also get a 200 Purged.</p> <p>Now if I try:</p> <pre><code>curl -I http://example.com/my-url -H "Accept-Encoding: deflate" </code></pre> <p>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.</p> <p>The page also has an Age: header indicating that it's being cached.</p> <p>Now how do I purge that? (Am I asking a moot question?)</p> <p>All of these attempts return "404 Not in cache":</p> <pre><code>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" </code></pre> <p>Is there a magic way to purge all of the variants of a URL?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload