Caching prob with AHCM and headers, was:[Zope] Caching prob with headers or reverse proxy?
Well I did some more research: AHCM does _not_ work out of the box, at least not with Apache as cache in front. Setting the headers via a dtml-method indeed does. With AHCM there are headers set but these don't trigger the caching, the headers I set with DTML do the trick. Maybe it's just a simple glitch in AHCM? Question front up: Can anyone tell about how to write a general global procedure/function/object that is called every time when any object is delivered? I would use that to test functionality before later maybe putting it into AHCM. Any hint? Here comes the headers and the logs, remember, Zope with caching Apache in front: Plain, without anything ----------------------- Header: HTTP/1.1 200 OK Date: Fri, 25 Apr 2003 11:04:24 GMT Server: Zope/(Zope 2.6.1 (source release, python 2.1, linux2), python 2.2.2, linux2) ZServer/1.1b1 Content-Length: 357 Etag: Content-Type: text/html Via: 1.1 wof1.desy.de (Apache/1.3.27) X-Cache: MISS from wof1.desy.de Connection: close Apache: 131.169.40.79 - - [25/Apr/2003:13:04:24 +0200] "GET /Germerstuff/dritte_seite HTTP/1.0" 200 357 "-" "Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a" Zope: 131.169.40.79 - Anonymous [25/Apr/2003:13:04:24 +0200] "GET /VirtualHostBase/http/wof1.desy.de:80/VirtualHostRoot/Germerstuff/dritte_sei te HTTP/1.1" 200 586 "" "Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a" With AHCM --------- Header: HTTP/1.1 200 OK Date: Fri, 25 Apr 2003 10:59:44 GMT Server: Zope/(Zope 2.6.1 (source release, python 2.1, linux2), python 2.2.2, linux2) ZServer/1.1b1 Content-Length: 357 Etag: Cache-Control: max-age=3600000 Expires: Fri, 06 Jun 2003 02:59:44 GMT Content-Type: text/html Via: 1.1 wof1.desy.de (Apache/1.3.27) X-Cache: MISS from wof1.desy.de Connection: close Apache: 131.169.40.79 - - [25/Apr/2003:12:59:44 +0200] "GET /Germerstuff/dritte_seite HTTP/1.0" 200 357 "-" "Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a" Zope: 131.169.40.79 - Anonymous [25/Apr/2003:12:59:44 +0200] "GET /VirtualHostBase/http/wof1.desy.de:80/VirtualHostRoot/Germerstuff/dritte_sei te HTTP/1.1" 200 658 "" "Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a" With headers set via DTML ------------------------- Header: HTTP/1.1 200 OK Date: Fri, 25 Apr 2003 11:09:38 GMT Server: Zope/(Zope 2.6.1 (source release, python 2.1, linux2), python 2.2.2, linux2) ZServer/1.1b1 Last-Modified: Fri, 25 Apr 2003 11:02:32 +0000 Content-Length: 301 Expires: Fri, 25 Apr 2003 12:09:26 +0000 Content-Type: text/html Via: 1.1 wof1.desy.de (Apache/1.3.27) Age: 12 X-Cache: HIT from wof1.desy.de Connection: close Apache: 131.169.40.79 - - [25/Apr/2003:13:09:38 +0200] "GET /Germerstuff/dritte_seite HTTP/1.0" 200 301 "-" "Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6a" Zope: No hit, like desired.
-----Ursprüngliche Nachricht----- Von: Dylan Reinhardt [mailto:zope@dylanreinhardt.com] Gesendet: Donnerstag, 24. April 2003 16:05 An: Germer, Carsten Cc: 'zope@zope.org' Betreff: Re: AW: [Zope] Caching prob with headers or reverse proxy?
On Thu, 2003-04-24 at 06:11, Germer, Carsten wrote:
Sorry for the late answer. Yes, that works :) but I would need to do a lot of work by hand.
If you're using standard_html_headers, this job might be made considerably shorter by adding these headers to your existing header object(s).
I understand that "Accellerated HTTP Cache Manager" doesn't
do the trick?
Why is it in the distribution then, anyway?
I don't use AHCM, but I'm pretty sure this is exactly what it does.
Dylan
On Fri, 25 Apr 2003 13:24:22 +0200 "Germer, Carsten" <carsten.germer@desy.de> wrote:
Well I did some more research: AHCM does _not_ work out of the box, at least not with Apache as cache in front. Setting the headers via a dtml-method indeed does. With AHCM there are headers set but these don't trigger the caching, the headers I set with DTML do the trick. Maybe it's just a simple glitch in AHCM?
The correspondig code in Zope2.6.1 in AHCM looks like this if not anon and self.anonymous_only: return # Set HTTP Expires and Cache-Control headers seconds=self.interval expires=rfc1123_date(time.time() + seconds) # RESPONSE.setHeader('Last-Modified',rfc1123_date(time.time())) RESPONSE.setHeader('Cache-Control', 'max-age=%d' % seconds) RESPONSE.setHeader('Expires', expires) So specifically the last modified is commented out. I presume there was a reason for this. I need to do some digging in the mailing archives and the cvs logs first. __Janko
participants (2)
-
Germer, Carsten -
Janko Hauser