[Zope] Cacheing

Peter Sabaini cccp@oeh.tu-graz.ac.at
Tue, 14 Sep 1999 20:27:17 +0200 (CEST)


On Tue, 14 Sep 1999, Jason Jones wrote:

:----- Original Message -----
:From: Peter Sabaini <cccp@oeh.tu-graz.ac.at>
:To: Jason Jones <jason_j@countermedia.org>
:Cc: <zope@zope.org>
:Sent: Tuesday, September 14, 1999 12:42 PM
:Subject: Re: [Zope] Cacheing
:
:
:> On Tue, 14 Sep 1999, Jason Jones wrote:
:>
:> :As I understand it, this scheme would pretty much create a cached copy of
:> :the rendered object which would itself live in the ZODB. It seems like
:there
:> :is still a performance penalty with keeping the cached item in the ZODB
:> :though (even when the object is in-memory), for instance I can serve
:30-40
:> :concurrent static DTML Documents from ZServer on my machine, but when I
:> :render the same material to disk and serve from apache the performance
:leaps
:> :ahead. Maybe a top-level cache should bypass the ZODB altogether if it
:can,
:>
:> why not just use some separate subsystem for caching, eq. a squid
:> in httpd accelerator mode?
:>
:> it would be necessary to set appropriate cache control headers and
:> expiry dates. i think this would be possible with zope?
:
:I'm not that familiar with squid. How would you sync expiration from squid
:with objects changing in zope? I don't want a hard time to expire, rather I
:want my cache to refresh its contents as my backend changes (for most
:objects, others will need a hard expire date). Would I need to
:programmatically remove cached items from squid when the ZODB is updated so
:that Zope gets hit and the cache reloaded, or can squid check against ZODB
:modification times to see that my objects have changed? Is it
:straightforward to do this? if it isn't then squid doesn't do me much good
:unless I render everything to the filesystem every time something changes.
:
:These might be dumb questions, but like I said I don't know that much about
:squid. I understand that it is a proxy server, but it doesn't have any zope
:integration does it?

you could set a cache control header to  "must-revalidate". 

a caching proxy then would check back with an "If-Modified-Since"
request to see if the object was modified since the last request. 

zope / apache would have to provide "Last-Modified" headers in
order to make this work.

note that this isn't specific to squid. rather this would affect
many kinds of caches and proxys.

see 

  http://www.mnot.net/cache_docs/

or the http protocol

  http://www.w3.org/Protocols/

heres an engine which checks for cacheability (http://www.zope.org
is not...):

  http://www.ircache.net/cgi-bin/cacheability.py

peter.
_________________________________________________
peter sabaini, mailto: c c c p@oeh.tu-graz.ac.at,
http://oeh.tu-graz.ac.at/~cccp/
- - - - - - - - - - - - - - - - - - - - - - - - -
Any sufficiently perverted technology is 
indistinguishable from Perl. (ca. a.c. clarke)
-------------------------------------------------