Thanks for those links. Based on them I've changed the autohandler to:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; lang="en-US">

<head>

<%shared>
use HTTP::Date;
my $t = time();
my $expiry_time = time2str( $m->base_comp->attr( "cache_seconds" ) + $t );
my $current_time = time2str( $t );

eval { $r->set_last_modified( $current_time ); };
$r->header_out( 'Expires', $expiry_time );
$r->header_out('Cache-Control', "max-age=" . $m->base_comp->attr(
"cache_seconds" ) );

</%shared>

It seems to be working.

The eval is necessary because my development system uses Mason under cgi and
so the method set_last_modified doesn't exist.

I've given up on http-equiv.

Regards

Duncan
-----Original Message-----
From: John Peacock [mailto:[EMAIL PROTECTED]
Sent: 17 January 2007 18:48
To: Duncan Garland
Cc: Mason-Users
Subject: Re: [Mason] Client side page caching


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

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748


-------------------------------------------------------------------------
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
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to