Not Purging since 3.7.2
-
No longer purging varnish cache after updating recently. I have to restart the service manually.
-
How are you purging manually? Just a service restart?
Can you run a CURL flush normally?
curl -X PURGE "https://www.example.com/.*"
Or if you use CloudFlare it’s
curl -X PURGE "https://123.45.67.89/.*" -H "host:https://www.example.com"
Where 123.45.67.89 is your domain?
Can you monitor your log and see if the commands are being sent?
I am on CloudFlare, getting a forbidden
curl -X PURGE "https://www.htpcguides.com/.*" <html> <head><title>403 Forbidden</title></head> <body bgcolor="white"> <center><h1>403 Forbidden</h1></center> <hr><center>cloudflare-nginx</center> </body> </html> @htpcguides:~# curl -X PURGE "https://ip of vps/.*" -H "host:https://www.htpcguides.com" <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>405 Not allowed.</title> </head> <body> <h1>Error 405 Not allowed.</h1> <p>Not allowed.</p> <h3>Guru Meditation:</h3> <p>XID: 1705463513</p> <hr> <p>Varnish cache server</p> </body> </html>
I just added the VPS IP to the acl list (it was only localhost) and now I get this after curl
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>200 Purged.</title> </head> <body> <h1>Error 200 Purged.</h1> <p>Purged.</p> <h3>Guru Meditation:</h3> <p>XID: 809447638</p> <hr> <p>Varnish cache server</p> </body> </html>
Does that mean the plugin is working now? Because that second curl, with the ip, is what the plugin is effectively running.
Error 200, stupidly, means a success.
I just confirmed the plugin is not working, I still have to restart manually. It worked fine before the update. I do know CloudFlare recently changed their dashboard but didn’t hear anything about varnish. Do you know anything about that?
Nope. But you can try using the older version of the plugin to see if it’s that: https://downloads.www.ads-software.com/plugin/varnish-http-purge.3.7.1.zip
Edited: I’m assuming you already read the plugin FAQ and followed the directions about adding in the ip for cloud flare to work, mind, since the implication was it used to work, and all that changed was the update.
I was always using w3 total cache to purge but since switching cache plugins taht didn’t have built-in varnish purge I had to use your plugin. I just switched back to w3 total cache which purges varnish cache just fine.
Not sure what is up with your plugin but I don’t have time to test, hopefully this doesn’t affect more users than just me.
There really weren’t a lot of changes: https://plugins.trac.www.ads-software.com/changeset?sfp_email=&sfph_mail=&reponame=&new=1179220%40varnish-http-purge&old=1116450%40varnish-http-purge&sfp_email=&sfph_mail=
And so far you’re the only report of it not working.
What plugins and theme are you using? Maybe I can reproduce it.
I never used older versions so it’s possible it never worked for me.
I use Mantle https://www.ads-software.com/themes/mantle/
I have about 40 plugins installed so it’s quite ridiculous, but if you want a list I can take a screenshot.
My varnish server is running on the same device and is set to allow 127.0.0.1. Here is the config file
/* SET THE HOST AND PORT OF WORDPRESS * *********************************************************/ backend default { .host = "127.0.0.1"; .port = "8080"; } # SET THE ALLOWED IP OF PURGE REQUESTS # ########################################################## acl purge { "localhost"; "127.0.0.1"; } #THE RECV FUNCTION # ########################################################## sub vcl_recv { # For Testing: If you want to test with Varnish passing (not caching) uncomment # return( pass ); # FORWARD THE IP OF THE REQUEST if (req.restarts == 0) { if (req.http.x-forwarded-for) { set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip; } else { set req.http.X-Forwarded-For = client.ip; } } # CLEAN UP THE ENCODING HEADER. # SET TO GZIP, DEFLATE, OR REMOVE ENTIRELY. WITH VARY ACCEPT-ENCODING # VARNISH WILL CREATE SEPARATE CACHES FOR EACH # DO NOT ACCEPT-ENCODING IMAGES, ZIPPED FILES, AUDIO, ETC. # ########################################################## if (req.http.Accept-Encoding) { if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") { # No point in compressing these remove req.http.Accept-Encoding; } elsif (req.http.Accept-Encoding ~ "gzip") { set req.http.Accept-Encoding = "gzip"; } elsif (req.http.Accept-Encoding ~ "deflate") { set req.http.Accept-Encoding = "deflate"; } else { # unknown algorithm remove req.http.Accept-Encoding; } } # IF THIS IS A PURGE REQUEST, THEN CHECK THE IPS SET ABOVE # BLOCK IF NOT ONE OF THOSE IPS # ########################################################## if (req.request == "PURGE") { if ( !client.ip ~ purge ) { error 405 "Not allowed."; } return (lookup); } # PIPE ALL NON-STANDARD REQUESTS # ########################################################## if (req.request != "GET" && req.request != "HEAD" && req.request != "PUT" && req.request != "POST" && req.request != "TRACE" && req.request != "OPTIONS" && req.request != "DELETE") { return (pipe); } # ONLY CACHE GET AND HEAD REQUESTS # ########################################################## if (req.request != "GET" && req.request != "HEAD") { return (pass); } # OPTIONAL: DO NOT CACHE LOGGED IN USERS (THIS OCCURS IN FETCH TO, EITHER # COMMENT OR UNCOMMENT BOTH # ########################################################## if ( req.http.cookie ~ "wordpress_logged_in" ) { return( pass ); } # IF THE REQUEST IS NOT FOR A PREVIEW, WP-ADMIN OR WP-LOGIN # THEN UNSET THE COOKIES # ########################################################## if ( !(req.url ~ "wp-(login|admin)") && !(req.url ~ "&preview=true" ) ){ unset req.http.cookie; } # IF BASIC AUTH IS ON THEN DO NOT CACHE # ########################################################## if (req.http.Authorization || req.http.Cookie) { return (pass); } # IF YOU GET HERE THEN THIS REQUEST SHOULD BE CACHED # ########################################################## return (lookup); if (req.http.Host == "pmadomain.com") { return (pass); } } # HIT FUNCTION # ########################################################## sub vcl_hit { # IF THIS IS A PURGE REQUEST THEN DO THE PURGE # ########################################################## if (req.request == "PURGE") { purge; error 200 "Purged."; } return (deliver); } # MISS FUNCTION # ########################################################## sub vcl_miss { if (req.request == "PURGE") { purge; error 200 "Purged."; } return (fetch); } # FETCH FUNCTION # ########################################################## sub vcl_fetch { # I SET THE VARY TO ACCEPT-ENCODING, THIS OVERRIDES W3TC # TENDANCY TO SET VARY USER-AGENT. YOU MAY OR MAY NOT WANT # TO DO THIS # ########################################################## set beresp.http.Vary = "Accept-Encoding"; # IF NOT WP-ADMIN THEN UNSET COOKIES AND SET THE AMOUNT OF # TIME THIS PAGE WILL STAY CACHED (TTL) # ########################################################## if (!(req.url ~ "wp-(login|admin)") && !req.http.cookie ~ "wordpress_logged_in" ) { unset beresp.http.set-cookie; set beresp.ttl = 24h; } if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { set beresp.ttl = 120 s; return (hit_for_pass); } return (deliver); } # DELIVER FUNCTION # ########################################################## sub vcl_deliver { # IF THIS PAGE IS ALREADY CACHED THEN RETURN A 'HIT' TEXT # IN THE HEADER (GREAT FOR DEBUGGING) # ########################################################## if (obj.hits > 0) { set resp.http.X-Cache = "HIT"; # IF THIS IS A MISS RETURN THAT IN THE HEADER # ########################################################## } else { set resp.http.X-Cache = "MISS"; } }
May as well list the plugins (If you want to just do an
ls -lah
of the wp-content/plugins folder, that works too, better than a screenshot ?? I can copy paste from that)No problem, here you go. I won’t be able to test it or anything just so you know but it should be enough info for you to diagnose the issue. I was using varnish 3 and Apache.
advanced-excerpt sticky-menu-or-anything-on-scroll fix-gp-premium wp-insert readme.txt wordpress-popular-posts simple-custom-css contextual-related-posts contact-form-7 wpclef simple-share-buttons-plus .. homepage_excerpts.zip visual-editor-custom-buttons rocket-lazy-load sem-external-links image-zoom all-in-one-schemaorg-rich-snippets better-delete-revision mailchimp-for-wp pretty-link paypal-donations pluginception tablepress really-simple-captcha gp-premium featured-images-for-rss-feeds easyazon-pro-4.0.7 . simple-image-sizes recently disqus-conditional-load findsql nxs-snap-pro-upgrade highlight-rightclick-disabler all-in-one-wp-security-and-firewall sociallocker-next-premium easyazon ewww-image-optimizer index-wp-redis.php w3-total-cache page-number-styles index.php updraftplus wordpress-seo slidedeck-lenses wp-category-tag-could social-networks-auto-poster-facebook-twitter-g
Fix gp premium is a custom plugin as is highlight-rightclick-disabler
Yep, this plugin does not work.
VPS – Nginx + HHVM + PHP-FPM + Varnish
alx999 – I’d love some information about it, because its working great for 10k people right now on VPS, Apache, PHP (or HHVM), and Varnish.
blindpet actually never had a working version, so it’s not that it just ‘stopped’ purging, it’s that for his setup it didn’t work, and I’ve yet to be able to reproduce exactly why. Even using most (not all) of those plugins it works :/
Just wanted to let you know I am using W3 Total Cache and it purges varnish successfully, both for individual posts and emptying the whole cache.
Before I was using WP-rocket and your plugin did not work with that on my setup even though that is what they recommended I use.
Unfortunately I am migrating to nginx so that is what my test server is running and varnish isn’t installed there yet but if I do decide to use varnish again I will give you access to the test server to debug.
- The topic ‘Not Purging since 3.7.2’ is closed to new replies.