Plone viewlet for purging varnish cache for given url.
Project description
stxnext.varnishpurger
Overview
A viewlet containing the link to perform action of purging varnish cache for actual object’s views.
Installation
If you are using zc.buildout to manage your project, you can do this:
Add stxnext.varnishpurger to the list of eggs to install, e.g.:
[buildout] ... eggs = ... stxnext.varnishpurger
If you’re using plone.recipe.zope2instance recipe to manage your instance add this lines to install a ZCML slug:
[instance] recipe = plone.recipe.zope2instance ... zcml = ... stxnext.varnishpurger
Re-run buildout, e.g. with:
$ ./bin/buildout
You can skip the ZCML slug if you are going to explicitly include the package from another package’s configure.zcml file.
Finally go to portal_quickinstaller and install stxnext.varnishpurger product.
Usage
After installation one new viewlet above object’s content will be displayed. The viewlet contains a link to purge content of actual url from varnish cache. In site properties there is additional configuration where you can define the address of varnish instance url (by default: localhost:6081).
The varnish configuration file should contain customized vcl_recv subroutine to purge given object by it’s UID:
sub vcl_recv { ... if (req.request == "PURGE") { if (!client.ip ~ purge) { error 405 "Not allowed."; } purge("obj.http.X-Context-Uid ~ " req.url); error 200 "Purged"; return(lookup); } ... }
Tested With
Plone 3, Plone 4 and Varnish 2.1.x
Source
http://svn.plone.org/svn/collective/stxnext.varnishpurger/trunk
References
varnish: http://www.varnish-cache.org
Plone: http://plone.org
Changelog
0.2.0 (2011-11-03)
Fixes to work with Plone 4.1 [radekj]
0.1.2 (2011-05-13)
Moved to collective svn, updated docs [radekj]
0.1.1 (2010-05-24)
Fixed setting UID in http header for FSPageTemplate views [radekj]
0.1.0 (2010-05-13)
Initial release [radekj]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file stxnext.varnishpurger-0.2.0.tar.gz
.
File metadata
- Download URL: stxnext.varnishpurger-0.2.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101fee9ee83996e53a2ecdc9e2c0880035be682ed1f5fc98fcbfc9d452b21b1f |
|
MD5 | 34fd83676c68654b475c96d6c2be6940 |
|
BLAKE2b-256 | f87104a2cb602c29726acf91925fdfd5e69217179f340f01b1c33a1b02ab681f |