FOSHttpCache icon indicating copy to clipboard operation
FOSHttpCache copied to clipboard

support varnish management port for banning

Open dbu opened this issue 11 years ago • 5 comments

instead of sending special requests to the varnish frontend (and have rules that check every request for being a purge from the webserver), one could also use the tcp interface of varnish to send ban / purge requests over a different channel.

the user of the bundle should be able to call the same methods whether he uses the frontend purge controller or the one using the administration port.

http://www.varnish-cache.org/docs/3.0/reference/varnishd.html#management-interface

see also TODO in https://github.com/liip/CacheControlBundle/blob/master/Helper/Varnish.php

dbu avatar May 08 '14 11:05 dbu

maybe go with http://www.php.net/manual/en/class.varnishadmin.php - also for hhvm http://docs.hhvm.com/manual/en/varnish.example.admin.php

dbu avatar May 15 '14 07:05 dbu

VarnishAdmin requires the Varnish PECL module, which doesn't seem to be available as a system package at least on Debian/Ubuntu and RedHat/CentOS. For me, this is an import reason to create our own client.

ddeboer avatar May 16 '14 07:05 ddeboer

By the way, it seems varnishadm does not support purge and refresh. Should we then implement our proxy client’s purge() method as a simple ban? We could fake refresh by banning first and then requesting the URL right after.

ddeboer avatar Jul 20 '14 10:07 ddeboer

hm. i guess that is always possible. or we allow to have several clients in the admin, one for purge and another one for ban. though the main value of having a varnishadm ban client would be that you don't need to clutter your varnish configuration with invalidation things. what about refresh?

but lets get 1.0 out before we start on this. if its a new proxy client implementation, we can easily add it in 1.1

dbu avatar Jul 20 '14 10:07 dbu

Doesn’t need custom VCL, so that’s good.

ddeboer avatar Jun 26 '15 14:06 ddeboer