How PURGE works

Paul A. Procacci pprocacci at datapipe.com
Thu Mar 14 17:44:01 CET 2013


> a) As per the guide line when I will write 'purge' content management
> system send a special HTTP request to Varnish. So, is this request sending
> done automatically or my own program need to send a request with
> request.method ='PURGE'

Whether the request is done automatically or not depends on the CMS.  I assume
the CMS has built in functionality to make the request.  You'll need to read
the documentation that came with the CMS to determine how it's handled.
Assume it's done for you though.

> b) In the below program to purge a object VCL check is the request is with
> 'PURGE'. But if I am initiating purge for the first time then how the
> req.request will be 'PURGE'?

You can simulate a purge by sending the following bytes to varnish:

PURGE /url HTTP/1.0

You can send this via telnet, or a programming language of your choice, but
ultimately this is how request.method gets set to 'PURGE'.

~Paul

________________________________

This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.



More information about the varnish-misc mailing list