http purge help

Stig Sandbeck Mathisen ssm at linpro.no
Fri Feb 22 08:28:38 CET 2008


Charlie Farinella <cfarinella at appropriatesolutions.com> writes:

> Perhaps we just misunderstand what should be happening.  What
> exactly will the command 'PURGE /' remove from the cache?  We are
> trying to empty it.

It will purge the document hashed with the host name in the Host:
header.  If you send a PURGE, you need to send one request per host
name for every hostname that can be used to access that page.  If you
have several hostnames, you will need to purge for instance:

* http://www.example.com/KjempeStortPinnsvin

  PURGE / HTTP/1.1
  Host: www.example.com
  

* http://home.example.com/KjempeStortPinnsvin

  PURGE / HTTP/1.1
  Host: home.example.com

* http://example.com/KjempeStortPinnsvin

  PURGE / HTTP/1.1
  Host: home.example.com

If you add more items to your hash used to store and lookup items in
Varnish, this can soon get out of hand. :D

Running "varnishlog" will give you lots and lots of details.  See
http://varnish.projects.linpro.no/wiki/FAQ#HowcanIdebugtherequestsofasingleclient
for how to limit the output to just your client.

> We need to have web developers have the ability to clear the Varnish
> cache.  Currently we are doing it for them by telneting to the
> Varnish management interface and running 'url.purge *'.  We'd like
> to protect them (and us) from that if possible.

That's a good thought. :D

-- 
Stig Sandbeck Mathisen, Linpro



More information about the varnish-misc mailing list