I can add that in. Since on most varnish caches the regular purge is around 15 min it didn’t seem like it needed to be that immediate. I was trying to limit what I purge on publish to keep the load low.
Shiny, I’d appreciate it. I’m happy to offer a donation bounty as an encouragement. 🙂
On a related note, is there some sort of debug mode so one could view the response from the Varnish server to confirm that it’s correctly received the request and has acted on it or? It’d be nice to make sure things are working correctly or, if not, what the error message is.
I ask because my host has a particular arrangement where, instead of running Varnish on the same server as Apache, there’s an array of load-balanced Varnish caches that sit in front of the back-end web servers. The Varnish caches hold onto data for a long time without automatically purging. This causes issues if I don’t manually purge the cache for the feed, as subscribers won’t see any new postings until I get around to doing that: I’ve had stale data sitting in the cache for around a week before I finally got wise and manually purged it.
Okay, feeds in 3.5!
Monitoring Varnish Servers… Not at this time, since I don’t know of a way without tapping into the varnish commands on your box to pull up the log. And that may be different on your server :/
Generally I run varnishstat to see what’s going on, or I watch varnishncsa -F "%m %U" for all requests.
If you want to grab the last purge requests, it’s this:
varnishlog -d -c -m RxRequest:PURGE
And this will show you if the WP button was used:
varnishlog -d -c -m RxURL:.*vhp_flush_all.*
Feeds was ugly till I remembered arrays 🙂
Awesome. That was quick, and it works great. Thanks!
Do you have a PayPal link or some other way for me to send you a bit of cash?
In regards to Varnish itself, thanks for the tips and I totally understand there’s not any way to read the logs (I can’t either: they’re on separate, dedicated cache servers run by the host.) from within WordPress. I was just hoping there’d be a way to see if the response had a 200 HTTP status code or some other error code that might indicate something went wrong.
Sure: http://helf.us/paypal (look you do things your way…).
As far as WP and the server is concerned, varnish is it’s own thing, and is between it and the world, so it can’t really get an error like that, that I know of. I’m gonna ask my coworkers who may know!
Cool. I sent you a few bucks. Thanks again for the quick response.
In regards to Varnish, I’m afraid I don’t really know the details, but https://www.varnish-cache.org/docs/3.0/tutorial/purging.html seems to suggest that the Varnish server can respond with various HTTP status codes to indicate if it’s successfully purged the cache. I know my particular host does, but I have no idea if that’s a universal thing or not.
Honestly, don’t worry about the status code thing. I was more or less thinking out loud. 🙂
Ahhhh, wait you’re right! It should have an ‘error’ code of 200 on DreamHost. I wonder if that’s the same for everyone.