You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Clinton Gormley <cl...@traveljury.com> on 2009/11/25 17:12:35 UTC

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

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