[Product-Developers] Purge Varnish cache from control panel

Espen Moe-Nilssen espen at medialog.no
Tue Mar 31 09:44:29 UTC 2009


This is not really something I know a lot about, but I thought  
CacheFu is where/what you should look at:

/portal_cache_settings


gives med the option to clear the cache.

I thinkt this works quite OK (although I have only used it with squid)




Den 31. mar. 2009 kl. 00.06 skrev Bill Freeman:

> I'm writing a little product to allow plone manager role users to  
> have Varnish purge its cache by clicking a button in plone.
>
>
> 1.  Am I re-inventing the wheel here?  That is, is there already  
> such a product which I haven't noticed?
>
>
> I already have a tested python module that telnets to the Varnish  
> CLI, commands the purge, and parses the response.
>
>
> It seems to me that the proper place for such a button is in the  
> @@maintenance-controlpanel.
>
>
> 2.  Are there good reasons not to put it there?
>
>
> I can subclass  
> plone.app.controlpanel.maintenance.MaintenanceControlPanel to add a  
> an @form.action() decorated method to handle a "purgevarnish"  
> button, and to specify my template rather than the one in  
> plone.app.controlpanel, so that I can add a from/fieldset/submit  
> button.
>
>
> I don't see any hooks for plugging in, say, a structure provider to  
> add my form, which is why I'm using my own copy of the template.   
> That makes me vulnerable to any future incompatabe tempate changes  
> in plone.app.controlpanel, but I'm guessing that it is pretty stable.
>
>
>
> 3.  Am I missing a cleaner way to do this (still as a new button on  
> the maintenance controlpanel)?
>
>
>
> I don't add any new form data, so I presume that I can use the  
> existing MaintenanceControlPanelAdapter and its registration, just  
> registering a new browser page that uses my class instead.
>
>
> 4.  Are there issues with that plan?  For example, am I going to  
> have to come up with a way of making my registration more specific  
> than the base one?
>
>
> Thanks in advance for any help.
>
> Bill
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090331/599544ca/attachment.html>


More information about the Product-Developers mailing list