Varnish HTTP purge



  • Anyone have any ideas how I can get the HTTP method of purging working for Varnish as mentioned here: https://www.varnish-cache.org/docs/2.1/tutorial/purging.html ?  The current custom VCL functions don't seem to allow this.  I'm new to Varnish and VLC, so any help would be appreciated!  (Varnish seems light years ahead of Squid that I had been using!)

    Thanks!



  • Looking at http://blog.feryn.eu/2010/11/varnish-cache-purging/ I added the following to "vcl_recv_early" and basic tests seem to show it working!

    if(req.request == "DELETE") {
       purge_url(req.url);
       error 200 "Purged";
    }
    

    I changed the verb to "DELETE" to test in Fiddler on Windows since it doesn't allow custom verbs like "PURGE".

    I'd love to hear better/other approaches.  Thanks!



  • Purge is on the TODO list.
    Today varnish setup at pfsense respects client CTRL+F5 and no-cache directives.

    If you look at varnish docs, you will see that PURGE is done only by administrators and also can be done by console.

    If you realy need this at pfsense package gui, let me know how you need this and I Tell you if i can inplement or not.


Locked