-
-
10 Oct 2017 06:47:23 UTC
- Distribution: Mojolicious-Plugin-StaticCache
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (637 / 0 / 0)
- Kwalitee
Bus factor: 1- 93.10% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.2KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
++ed by:1 non-PAUSE user- Dependencies
- Mojolicious
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Mojolicious::Plugin::StaticCache - Mojolicious Plugin
SYNOPSIS
# Mojolicious $self->plugin('StaticCache'); # With options $self->plugin('StaticCache' => { even_in_dev => 1, max_age => 2592000 }); # Mojolicious::Lite plugin 'StaticCache'; # With options plugin 'StaticCache' => { even_in_dev => 1, max_age => 2592000 };
DESCRIPTION
Mojolicious::Plugin::StaticCache is a Mojolicious plugin which add a Control-Cache header to each static file served by Mojolicious.
OPTIONS
Mojolicious::Plugin::StaticCache supports the following options.
even_in_dev
# Mojolicious $self->plugin('StaticCache' => { even_in_dev => 1 });
Add the Cache-Control header even if Mojolicious mode is not 'production'.
Default is to not add the Cache-Control header if the mode is not 'production'.
max_age
# Mojolicious $self->plugin('StaticCache' => { max_age => 2592000 });
Specify the maximum cache time for the Cache-Control header.
Default is 2592000.
cache_control
# Mojolicious $self->plugin('StaticCache' => { cache_control => 'max-age=2592000, must-revalidate' });
Specify the content of the Cache-Control header.
Default is "max-age=$max_age, must-revalidate".
METHODS
Mojolicious::Plugin::StaticCache inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
BUGS and SUPPORT
The latest source code can be browsed and fetched at:
https://framagit.org/luc/mojolicious-plugin-staticcache git clone https://framagit.org/luc/mojolicious-plugin-staticcache.git
Bugs and feature requests will be tracked at:
https://framagit.org/luc/mojolicious-plugin-staticcache/issues
AUTHOR
Luc DIDRY CPAN ID: LDIDRY ldidry@cpan.org https://fiat-tux.fr/
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
Module Install Instructions
To install Mojolicious::Plugin::StaticCache, copy and paste the appropriate command in to your terminal.
cpanm Mojolicious::Plugin::StaticCache
perl -MCPAN -e shell install Mojolicious::Plugin::StaticCache
For more information on module installation, please visit the detailed CPAN module installation guide.