Catalyst::ActionRole::ExpiresHeader - Set default Expires header for actions
version 0.01
package MyApp::Controller::Foo; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller::ActionRole' } __PACKAGE__->config( action_roles => [qw( ExpiresHeader )], ); sub expire_in_one_day : Local Expires('+1d') { ... } sub already_expired : Local Expires('-1d') { ... }
Provides a ActionRole to set HTTP Expires header for actions, which will be set unless Expires header was already set.
Argument syntax matches the -expires from "CREATING_A_STANDARD_HTTP_HEADER:" in CGI.
-expires
Take a look at Catalyst::ActionRole::NotCacheableHeaders to make your action not cachable by default.
Alex J. G. Burzyński <ajgb@cpan.org>
This software is copyright (c) 2010 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catalyst::ActionRole::ExpiresHeader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::ActionRole::ExpiresHeader
CPAN shell
perl -MCPAN -e shell install Catalyst::ActionRole::ExpiresHeader
For more information on module installation, please visit the detailed CPAN module installation guide.