[Zope] Fixing refresh problems

Alexander Staubo alex@mop.no
Mon, 21 Jun 1999 18:58:01 +0200


What seems evident is that newer browsers such as IE 5.0 do not heed
Pragma and Expires headers correctly. The solution is to provide the
Cache-Control header, which supersedes the "Pragma: no-cache" header in
HTTP 1.1, thus:

Cache-Control: no-cache

The header permits other settings such as max-age (a variation of
expiry). See the HTTP 1.1 spec for more information.

The header can be emitted through a DTML Method in two ways:

1) Doing this:

  <!--#call "RESPONSE.setHeader('Cache-Control', 'no-cache')"-->

2) Putting this inside the HTML <head> block:

  <meta http-equiv="Cache-Control" contents="no-cache">

This works with ZServer 1.11.0pr1 on NT.

What bugs me is that ZServer doesn't handle If-Modified-Since correctly,
or doesn't seem to. Telnetting to ZServer and typing a future date value
doesn't elicit the expected 304 error ("Not modified"). Also, for me,
ZServer returns a Last-Modified timestamp that is an hour off. The
DateTime module seems to be slightly brain damaged in its handling of
time zones; if a document was modified at 18:00 GMT+1 (which is my time
zone), ZServer will emit:

  Last-Modified: Mon, 21 Jun 1999 16:00:00 GMT

I've never been a wizard with date arithmetic, but this looks weird to
me: When my local time is 18:00, this is 17:00 GMT time. Is this perhaps
related to the timezone bug that Dylan Jay posted a fix for a while
back?

--
Alexander Staubo             http://www.mop.no/~alex/
"It has taken the planet Earth 4.5 billion years to discover it is
4.5 billion years old." --George Wald