Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Using telnet:

telnet serverip 6082
purge req.url == "/images/"
share|improve this answer
    
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

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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