troubleshooting Varnish purges vs bans

Miguel González miguel_3_gonzalez at yahoo.es
Tue Aug 8 22:14:12 CEST 2017


Hi all,

  I have Wordpress sites server by an Apache Server (Cpanel) behind
Varnish.

  I´m trying to troubleshoot why Varnish http purge Wordpress plugin is
not purging well the Varnish cache when the clear cache button is pressed.

  However, when I run a ban manually from command line:

  echo "ban req.http.host ~ $URL" | varnishadm -S /etc/varnish/secret


 it seems to work clearing all content for that domain in the varnish cache.

 This is what I get when I purge the varnish cache from the plugin:


varnishlog -g request -q 'ReqMethod eq "PURGE"'

-   Begin          req 43813385 rxreq
-   Timestamp      Start: 1502221040.168021 0.000000 0.000000
-   Timestamp      Req: 1502221040.168021 0.000000 0.000000
-   ReqStart       178.33.117.62 34248
-   ReqMethod      PURGE
-   ReqURL         /.*
-   ReqProtocol    HTTP/1.1
-   ReqHeader      host: www.mydomain.com
-   ReqHeader      User-Agent: WordPress/4.8; https://www.mydomain.com
-   ReqHeader      Accept: */*
-   ReqHeader      Accept-Encoding: deflate, gzip
-   ReqHeader      Referer: http://www.mydomain.com/.*
-   ReqHeader      X-Purge-Method: regex
-   ReqHeader      Connection: close
-   ReqHeader      X-Forwarded-For: 178.33.117.62
-   VCL_call       RECV
-   ReqURL         /.*
-   ReqURL         /.*
-   ReqURL         /.*
-   ReqHeader      X-Port: 80
-   ReqUnset       X-Forwarded-For: 178.33.117.62
-   ReqHeader      X-Forwarded-For: 178.33.117.62
-   ReqUnset       host: www.mydomain.com
-   ReqHeader      Host: www.mydomain.com
-   ReqHeader      Cookie:
-   ReqUnset       Cookie:
-   ReqHeader      Cookie:
-   VCL_acl        MATCH purge "178.33.117.62"
-   VCL_return     purge
-   ReqUnset       Accept-Encoding: deflate, gzip
-   ReqHeader      Accept-Encoding: gzip
-   VCL_call       HASH
-   VCL_return     lookup
-   VCL_call       PURGE
-   VCL_return     synth
-   Timestamp      Process: 1502221040.168079 0.000058 0.000058
-   RespHeader     Date: Tue, 08 Aug 2017 19:37:20 GMT
-   RespHeader     Server: Varnish
-   RespHeader     X-Varnish: 43813386
-   RespProtocol   HTTP/1.1
-   RespStatus     200
-   RespReason     OK
-   RespReason     Purged
-   VCL_call       SYNTH
-   RespHeader     Content-Type: text/html; charset=utf-8
-   RespHeader     Retry-After: 5
-   VCL_return     deliver
-   RespHeader     Content-Length: 243
-   Storage        malloc Transient
-   RespHeader     Accept-Ranges: bytes
-   Debug          "RES_MODE 2"
-   RespHeader     Connection: close
-   Timestamp      Resp: 1502221040.168152 0.000131 0.000072
-   ReqAcct        223 0 223 216 243 459
-   End



------ manual ban ---------------

















More information about the varnish-misc mailing list