Stig Sandbeck Mathisen

NAME

Mojolicious::Plugin::CachePurge - Mojolicious Plugin to purge content from front end HTTP cache

SYNOPSIS

  # Mojolicious
  $self->plugin('CachePurge' => {baseurl = 'http://example.com'});

  # Mojolicious::Lite
  plugin 'CachePurge' => {baseurl = 'http://example.com'};

DESCRIPTION

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.

METHODS

Mojolicious::Plugin::CachePurge inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

  $plugin->register(Mojolicious->new);

Register plugin in Mojolicious application.

HELPERS

Mojolicious::Plugin::CachePurge implements the following helpers

purge

    # 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;
            ...
        }
    );

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us.