[Zope-dev] Last-modified and bobobase_modification_time
Dieter Maurer
dieter@handshake.de
Mon, 17 Jun 2002 19:37:36 +0200
R. David Murray writes:
> ...
> Well, there's two aspects to this. The first one is the quesiton of
> *why* the last modified header is currently that of the outermost
> page template. That's a zope@zope.org question. The second is
> the question of whether or not that is the "right" behavior, and what
> it would take to make Zope smarter such that the last modified header
> would actually be accurate.
Think about it. It is very difficult.
In order to determine the accurate modification time, you need
to render the template (as it is non-trivial to determine the
set of objects the rendering depends on without actually
doing the rendering).
Rendering may produce side effects. But "HEAD" requests
are required by HTTP not to have side effects. Thus,
you cannot have accurate modified headers for "HEAD" requests.
Moreover, usually "HEAD" requests do not pass the necessary
parameters for template rendering.
To get it right for non-"HEAD" requests, you would need to
pass an implicit state through most of the application.
Any time, you access an object's attribute, you must
take its last modification time into account, as the last
modification may have changed the attribute you are
accessing.
I expect, it will give a significant performance penalty, at least,
even when you come up with an ingenious implementation idea.
Dieter