cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: Cachable Readers
Date Mon, 12 Aug 2002 11:20:38 GMT
Amir Rosen wrote:
>
> Ok, what i'm saying is that if the cached version is used, then
> the methods
> getLastModified() & getMimeType() should be invoked on the cached
> object too,
> thus they shouldn't be called before generateValidity().
>
Ok, I think now I (finally - sorry, sometimes it takes a little
longer) understand it.

It is assumed that for the same source the reader returns the same
mimetype on each invokation, so it shouldn't play a role if
getMimeType() is called on the cached object or not (as the result
is assumed to be the same).

The other problem is that the current architecture has to first call
getLastModified() in order to handle http-expires headers more
efficient.

So, in general you're right, but you can implement your reader in the
following way:

You implement a private method _generateValidity collect the getLastModified
and the mimetype of the cached object and store the information in
your reader implementation.
Now the getLastModified calls your _generateValitiy() and gets the
information
from the cached object etc. Last, in the generateValidity() method you
return the result from  _generateValitiy().
So, although the methods are called (from the outside) in a different order,
your implementation changes this order to the needs of your implementation.

Carsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message