Hey there,
after a few years of using, modifying and hacking MT I've come to a point where I just don't how to achieve something. (If you don't know about Varnish, but know how to do some (CLI) action on comment publishing, you're welcome to read on, too :))
Primer: Currently, I use Intense Debate for commenting. I use it because it's being loaded dynamically. This allows me to have my blog extremely well cached using Varnish (nginx + Varnish + Movable Type Static Publishing = speeds beyond of crazy). But I'd love to get rid od it (privacy concerns etc.).
Now, I'm still more than comfortable with first page loading times if a page is uncached, and this is why I really want to use the internal commenting system again (another benefit: no unnecessary scripts = even more speed).
The thing is: my Varnish setup caches pages for an hour (and I'd like to keep that), which, of course, doesn't play nice along with static commenting systems.
Still reading? Great! So here's what I'd love to have: whenever someone publishes a comment, I want the Varnish cache to be purged (the page commented on, the index, the archive pages).
For this, I need to know how to trigger an action (http request, or, preferably, a CLI action) once the comment has been posted and a page rebuild is due. I suppose this could be done via a plugin, but alas, I don't know how to. If I had a plugin for this purpose, I'd need to pass alone the entry URI being commented on (Varnish is flexible with the rest, , ~ archive would flush the entire archive, ^/$ the index.).
Do you know how to do that? I think a general action on "publishing" and not just commenting would be fine, too, if it's triggered anyway.
Thanks in advance for any help that points me to the right direction. Eternal gratitude (and a mention upon a solution if desired) shall be yours!
Yours,
- Ben
Reported on Movable Type 5

Hi Ben,
There is no solution for what you want at this time, not only with this CMS, but also with other CMS solution that I know of.
However, this job could be achieved by coding a plugin which to flush the Varnish cache when an individual article page is regenerated.
We could eventually code this plugin together as a consultancy item. How soon do you need it?
Kind Regards,
Mihai Bocsaru
----------------------------------
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
Hey Mihai,
thanks for taking the time to answer!
Now, as - despite what my setup might suggest - this is of interest for my personal, non-commercial blog (nof.io), a commercial solution may be of interest (as long as it's affordable for a private person), but it's not on my top priority list. I hope you understand this.
You're more than welcome to send me a cost estimate, though! If the price is right, and I don't find anything myself the next two days, I'll seriously consider this.
Oh, by the way, for WordPress there are lots of plugins which just do this (I just don't want to use WP for my blog):
Yours,
- Ben
Repost (I think the attached link list marked this as spam.)
Hey Mihai,
thanks for taking the time to answer!
Now, as - despite what my setup might suggest - this is of interest for my personal, non-commercial blog (nof.io), a commercial solution may be of interest (as long as it's affordable for a private person), but it's not on my top priority list. I hope you understand this.
You're more than welcome to send me a cost estimate, though! If the price is right, and I don't find anything myself the next two days, I'll seriously consider this.
Oh, by the way, for WordPress there are lots of plugins which just do this (I just don't want to use WP for my blog).
Yours,
- Ben
I think I'm onto something using the build_file callback. If I can pass the right argument (URI of the file being rebuilt), I might just have created (at least a base) for a general purpose Varnish cache purge plugin for Movable Type. Which would be awesome, of course.
Thanks for pointing me in the right direction, Mihai!
Nice, I got a working plugin running — and it has the modest name "Varnish Cache Purge Plugin". It's even configurable! As of yet, it still needs manual installation of Varnish::API (the CPAN module), but if anyone is already interested (especially in enhancing and developing it further), just let me know, I'll gladly pass it along.
…and I released the plugin.
The plugin can be found here.