[Zope-dev] AcceleratedHTTPCacheManager

Dirk Datzert dirk.datzert@tks-rasselstein.thyssenkrupp.com
Wed, 25 Sep 2002 20:45:15 +0200


Hi,

I found it useful if the AcceleratedHTTPCacheManager would sent a
cache-pragma of type 'no-cache' for authenticated user and objects which
should not be cached on authenticated connections.

I had configured a apache proxy and without that fix the mod_proxy will
always cache objects, regardless if the object should be cached or not !

AcceleratedHTTPCacheManager.py

    def ZCache_set

        ...


        if not anon and self.anonymous_only:
            # sent a no-cache pragma to the HTTPCache !
            expires=rfc1123_date(time.time() - seconds)
            RESPONSE.setHeader('Cache-Control', 'no-cache')
            RESPONSE.setHeader('Expires', expires)
        else:
            # Set HTTP Expires and Cache-Control headers
            seconds=self.interval
            expires=rfc1123_date(time.time() + seconds)
            RESPONSE.setHeader('Cache-Control', 'max-age=%d' % seconds)
            RESPONSE.setHeader('Expires', expires)

Regards,
Dirk