Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Bug in $r->no_cache(1) with mod_expires

Clinton Gormley

2009-11-25


Author LoginPost Reply
Hi all

I think that the behaviour of $r->no_cache(1) is buggy, when combined
with mod_expires.

I have:

  ExpiresDefault        "access plus 1 month"
  ExpiresActive On

then in my mod_perl code, I call $r->no_cache(1)

The headers that are returned are:

  Pragma: no-cache
  Cache-control: no-cache, max-age=864000
   Expires: Sat, 05 Dec 2009 16:08:53 GMT

Firefox doesn't cache this page, but IE6 - 8 does.

If I explicitly set the headers:

  $headers->set( 'Pragma',     'no-cache' );
  $headers->set( 'Cache-control', 'no-cache' );
  $headers->set( 'Expires',     -1 );

then I get:
  Pragma: no-cache
  Cache-control: no-cache
  Expires: -1

which works across all browsers.

Could the behaviour of no_cache() be changed to do this instead?

thanks

Clint


©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.