troubleshooting Varnish purges vs bans

Miguel González miguel_3_gonzalez at yahoo.es
Tue Aug 15 13:07:46 CEST 2017


On 08/11/17 12:22 PM, Dridi Boukelmoune wrote:
>>  The Wordpress plugin is supposed to clean the whole cache for a website
>> when clicking on a button saying "Clear cache".
>>
>>  You say from the varnishlog excerpt I sent that´s not the correct way
>> of doing so, or apparently what is logged by varnish is not a correct purge.
>>
>>  So how do I tell the developer (or do it myself) to correct the code so
>> the whole cache for a given website is purged?.
> 
> Use the ban() function in your VCL in this case.
> 
> Dridi
> 

I currently have in default.vcl this:

        # Allow purging from ACL
        if (req.method == "PURGE") {
                # If not allowed then a error 405 is returned
                if (!client.ip ~ purge) {
                        return(synth(405, "This IP is not allowed to
send PURGE requests."));
                }
                # If allowed, do a cache_lookup -> vlc_hit() or vlc_miss()
                return (purge);
        }


What do I have to change to use BAN? If I run ban at command line they
seem to work.

Do I need to change the Wordpress plugin to send BAN requests?

Thanks!

Miguel



More information about the varnish-misc mailing list