[Zope] Updating object's modification timestamp?

Alexander Staubo alex@mop.no
Fri, 25 Jun 1999 00:20:43 +0200


>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>Martijn Pieters
>Sent: 23. juni 1999 16:23
>To: Zope Mailing List (E-mail)
>Subject: RE: [Zope] Updating object's modification timestamp?
>
>
>At 15:28 23/06/99 , Brian Lloyd wrote:
>> > A better option would be to send DC a patch where you move
>> > the setting of
>> > the last-modified header to _before_ rendering the DTML,
>so it can be
>> > overridden in that DTML. Or so that it at least checks wether
>> > the DTML has
>> > set a last-modified header and leaves it intact.
>> >
>> > That way you can programmatically change the last-modified
>> > header sent to
>> > the browser. Much better solution.
>>
>>I suspect that this may be a non-issue - Alex, are you running
>>1.11.something by any chance? That release had the Last-Modified
>>setting code, but it has since been removed (since it was basically
>>there in an abortive attempt to handle If-Modified-Since) in CVS
>>and the latest Z2 alphas...
>
>So it is...
>
>So you just do RESPONSE.setHeader('last-modified',
>ADateTimeObject.rfc822())

Yes, except HTTP headers (should) use RFC 1123 date/times in headers,
not RFC 822. Furthermore the above just won't work on 1.11.0pr1 -- which
I'm not complaining about, waiting to upgrade to Zope 2.0.

_However_, I would like to reiterate that I don't think it's the
document's responsibility to send a correct LM header. Zope (or ZServer)
should return an 304 error if the browser requests a document that has
not been modified. This scheme isn't compatible at all with what you
guys are suggesting. Why? When, in the future, we'll have good HTTP/1.1
support in Zope/ZServer, the browser passes an If-Modified-Since header,
Zope will compare the date/time to the internal modification stamp on
the object. If the document is old, Zope will return an 304 (Not
Modified) response. In other words, the document will never be rendered
and the code to call RESPONSE.setHeader() will never be executed.

What's weird about IE 5.0, by the way, is that it uses Last-Modified to
determine whether its cached copy is more recent than the one returned
by the server, even though the server returns the whole document anyway
instead of a 304 (which, btw, is what Zope does), which, when you think
about it, is a little strange but sort of efficient, since the browser
can just ignore the data and subsitute its own cached data, even if the
document returned by the server is technically different/newer.

And that's why we need a touch() method, I think.

>
>--
>Martijn Pieters, Web Developer
>| Antraciet http://www.antraciet.nl
>| Tel: +31-35-7502100 Fax: +31-35-7502111
>| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
>| PGP:
>http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A3
2149
------------------------------------------

--
Alexander Staubo             http://www.mop.no/~alex/
"What the hell, he thought, you're only young once, and threw
himself out of the window. That would at least keep the element of
surprise on his side."
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_