]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/purge.mdwn
Change Projects link to point to projects DB
[ikiwiki.git] / doc / plugins / contrib / purge.mdwn
1 [[!template id=plugin name=purge core=0 author="[[users/ssm]]"]]
2
3 IkiWiki plugin to send PURGE requests to remote http cache server (like Varnish Cache) when your content changes.
4
5 PURGE requests are sent for the changed page, as well as all pages indirectly changed when ikiwiki rebuilds the web pages.
6
7 # Download
8
9 Download from [Github](https://github.com/ssm/ikiwiki-plugin-purge)
10
11 # Configure ikiwiki
12
13     # purge_url (mandatory), the address of your cache server.
14     purge_url: http://example.com/
15
16     # purge_timeout (optional, default 5) timeout in seconds for a purge request.
17
18     # purge_method (optional, default "PURGE") HTTP method to use.
19     
20 # Configure your cache server
21
22 For Varnish, you'll need to add a handler for the non-standard "PURGE" method, and preferrably an ACL which restricts who can send these requests to empty your cache.
23
24     acl origin_server {
25         "localhost";
26         "192.0.2.0"/24;
27         "2001:db8::"/64;
28     }
29  
30     sub vcl_recv {
31         if (req.method == "PURGE") {
32             if (!client.ip ~ origin_server) {
33                 return(synth(405,"Not allowed."));
34             }
35             return (purge);
36         }
37     }
38