Franck Cuny > Plack-Middleware-ETag-0.01 > Plack::Middleware::ETag

Download:
Plack-Middleware-ETag-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source   Latest Release: Plack-Middleware-ETag-0.03

NAME ^

Plack::Middleware::ETag - Adds automatically an ETag header.

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/];

AUTHOR ^

franck cuny <franck@lumberjaph.net>

SEE ALSO ^

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: