Re: output filter

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Thursday 28 January 2010 16:27:29 [email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.