-
-
15 Jul 2015 04:04:18 UTC
- Distribution: Plack-Middleware-ETag
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (823 / 0 / 0)
- Kwalitee
Bus factor: 0- 85.58% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (13.45KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Plack::Middleware::ETag - Adds automatically an ETag header.
VERSION
version 0.05
SYNOPSIS
use Plack::Builder; my $app = builder { enable "Plack::Middleware::ETag", file_etag => [qw/inode mtime size/]; sub {['200', ['Content-Type' => 'text/html'}, ['hello world']]}; };
DESCRIPTION
Plack::Middleware::ETag adds automatically an ETag header. You may want to use it with
Plack::Middleware::ConditionalGET
.my $app = builder { enable "Plack::Middleware::ConditionalGET"; enable "Plack::Middleware::ETag", file_etag => "inode"; sub {['200', ['Content-Type' => 'text/html'}, ['hello world']]}; };
CONFIGURATION
- file_etag
-
If the content is a file handle, the ETag will be set using the inode, modified time and the file size. You can select which attributes of the file will be used to set the ETag:
enable "Plack::Middleware::ETag", file_etag => [qw/size/];
- cache_control
-
It's possible to add 'Cache-Control' header.
enable "Plack::Middleware::ETag", cache_control => 1;
Will add "Cache-Control: must-revalidate" to the headers.
enable "Plack::Middleware::ETag", cache_control => [ 'must-revalidate', 'max-age=3600' ];
Will add "Cache-Control: must-revalidate, max-age=3600" to the headers.
- check_last_modified_header
-
Will not add an ETag if there is already a Last-Modified header.
AUTHOR
Franck Cuny <franckcuny@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Franck Cuny.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Plack::Middleware::ETag, copy and paste the appropriate command in to your terminal.
cpanm Plack::Middleware::ETag
perl -MCPAN -e shell install Plack::Middleware::ETag
For more information on module installation, please visit the detailed CPAN module installation guide.