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

Clinton Gormley <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
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
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.