Mojolicious::Plugin::CachePurge - Mojolicious Plugin to purge content from front end HTTP cache
# Mojolicious $self->plugin('CachePurge' => {baseurl = 'http://example.com'}); # Mojolicious::Lite plugin 'CachePurge' => {baseurl = 'http://example.com'};
Mojolicious::Plugin::CachePurge is a Mojolicious plugin to send cache invalidation requests to a web application accelerator like Varnish, or any other front end HTTP cache supporting PURGE requests.
Cache invalidation requests are non blocking.
Mojolicious::Plugin::CachePurge inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Mojolicious::Plugin::CachePurge implements the following helpers
# Purge this path $app->purge; # Purge some other path $app->purge( { path => '/some/other/path' } ); # Purge with callback. $app->purge( sub { my $tx = shift; ... } ); # Purge with path and callback $app->purge( { path => '/this/must/be/gone' }, sub { my $tx = shift; ... } );
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious::Plugin::CachePurge, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::CachePurge
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::CachePurge
For more information on module installation, please visit the detailed CPAN module installation guide.