Here's what I do in my autohandler:
$r = $m->apache_req;
if ( i don't want this page cached... typically all .html pages ) {
$r->no_cache( 1 );
}
elsif ( i do want this page cached... typically all .css and .js
pages ) {
$r->header_out( 'Cache-Control', "max-age=" . 86400 );
}
where '84600' is the number of seconds to cache (i.e., one day in this
case).
John Peacock wrote:
> Duncan Garland wrote:
>
>> I wonder if I should be setting more than one http-equiv header. Do they
>> exist for last-modified etc?
>>
>
> The http-equiv headers are a convenient fiction, i.e. they exist, but
> the browsers don't necessarily pay any attention to them, nor does the
> server change which HTTP headers will be sent based on the http-equiv
> headers.
>
> However, you can send arbitrary headers as desired:
>
> http://www.masonhq.com/docs/manual/1.05/Devel.html#sending_http_headers
>
> as long as you make sure that happens before any other output is sent.
> This page seems very useful as well:
>
> http://perl.apache.org/docs/general/correct_headers/correct_headers.html
>
> I found through lots of testing (and swearing) that having all HTTP
> three headers I mentioned was ideal for getting all common browsers to
> behave. You are testing with Opera, too, aren't you. And if you want
> to cry, try and get someone to test with Safari...
>
> John
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users