[ZCM] [ZC] 1345/ 1 Request "AcceleratedHTTPCacheManager doesn't set
Last-Modified"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Thu May 20 12:02:13 EDT 2004
Issue #1345 Update (Request) "AcceleratedHTTPCacheManager doesn't set Last-Modified"
Status Pending, Zope/bug+solution medium
To followup, visit:
http://collector.zope.org/Zope/1345
==============================================================
= Request - Entry #1 by slinkp on May 20, 2004 12:02 pm
Apparently, AcceleratedHTTPCacheManager does not set a Last-Modified header.
See http://www.vasudevaservice.com/documentation/articles/plone_speed
which proposes this patch and says:
"""This will ensure that Zope returns a valid Last-Modified HTTP header. Without it, caches will assume that your content has been dynamically generated and is not suitable for caching.
"""
The patch is simple:
*** AcceleratedHTTPCacheManager.py.OLD Thu May 20 11:34:34 2004
--- AcceleratedHTTPCacheManager.py Thu May 20 11:37:37 2004
***************
*** 99,105 ****
# 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)
--- 99,105 ----
# 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)
Note that I am not sure this is really the correct approach; we are ignoring the mtime_func which should probably be used instead of time.time().
Comments?
==============================================================
More information about the Zope-Collector-Monitor
mailing list