2

I am using Varnish 3.0.3

Presently I know how to purge single URLs using this VCL:

if (req.request == "PURGE") {
  if (!client.ip ~ purge) {
      error 405 "Not allowed";
  }
  return(lookup);
  error 200 "Purged";
}

I would like to issue a wildcard purge, such as:

PURGE: http://www.mysite.com/images/*

Does Varnish support this?

2

Using telnet:

telnet serverip 6082
purge req.url == "/images/"
  • Although I would have preferred an HTTP approach, this did work well. Thanks Paul. I wound up using varnishadm instead of telnet because our servers require authentication. – Gil Hildebrand Nov 1 '12 at 0:47
  • Hello, please try: varnishadm -T host:6082 purge req.url == "/images/" – Paul Nov 1 '12 at 4:51
0

The purge command was renamed to ban.url in Varnish 3.

The correct way would then be

ban.url "/images/*"

You can connect using telnet host:port or varnishadm -T host:port (the default port being 6082)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.