perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Förtsch <torsten.foert...@gmx.net>
Subject Re: output filter
Date Thu, 28 Jan 2010 16:00:26 GMT
On Thursday 28 January 2010 16:27:29 moli@normalperson.e4ward.com wrote:
> How to set the filter for some output headers?
> I want to add some Expire: and Cache-Control: headers to make
> downstream cacheserver to cache the pages.
> Though they are dynamic pages, but I think they are safe to be cachable.
> 
PerlOutputFilter "sub {                              \
  use strict;                                        \
  use Apache2::Filter ();                            \
  use Apache2::RequestRec ();                        \
  use Apache2::Const -compile=>qw/DECLINED/;         \
  my ($f)=@_;                                        \
  @{$f->r->headers_out}{qw/Expire Cache-Control/}=   \
    (q{...}, q{...});                                \
  $f->remove;                                        \
  return Apache2::Const::DECLINED;                   \
}"

Fill in the 2 ellipses.

Torsten


Mime
View raw message