Re: [Zope-dev] ZopeBug: No Last-Modified for misc_/.../*.gif objects!!!!
The Doctor What writes:
I was looking at the cacheability of my website in zope, and saw that the misc_/OFSP/*.gif images (as in the icon objects) are NOT cacheable because they don't return *any* date info. If they *at least* returned a Last Modified, they'd be cacheable. My browser (Netscape 4.74) happily cashes these images.
It is not clear, why a "Last Modified" header should be a precondition for caching. I would expect it is only necessary, if you told your browser (or other cache) to verify freshness for each request. If the browser has a "Last Modified", it sends an "If-Modified-Since" header and get a 304 response, if not. Dieter
* Dieter Maurer (dieter@handshake.de) [001116 16:17]:
The Doctor What writes:
I was looking at the cacheability of my website in zope, and saw that the misc_/OFSP/*.gif images (as in the icon objects) are NOT cacheable because they don't return *any* date info. If they *at least* returned a Last Modified, they'd be cacheable. My browser (Netscape 4.74) happily cashes these images.
It is not clear, why a "Last Modified" header should be a precondition for caching.
I would expect it is only necessary, if you told your browser (or other cache) to verify freshness for each request. If the browser has a "Last Modified", it sends an "If-Modified-Since" header and get a 304 response, if not.
Ah, but you see, I have a caching proxy! Squid. My netscape cache's the images (ie, writes them to disk) but they are overwritten everytime. Since I connect via modem, I can watch them repopulate slowly. Even if Netscape does hold on to them without a caching proxy, we couldn't rely on that behavior. This problem makes 'icon' an undesireable object to use. Ciao! -- King: Chiswick, remind me to send flowers to the King of France in sympathy for the death of his son. Chiswick: The one you had murdered, My Lord King: Yes, that's the fellow. --Blackadder I The Doctor What: <fill in the blank> http://docwhat.gerf.org/ docwhat@gerf.org KF6VNC
The Doctor What writes:
.... missing "Last-Modified" header for "App.ImageFile" objects prevents caching ....
Appended is a partial patch. It adds the "Last-Modified" header but does not handle "If-Modified-Since" headers in requests. I have put the patch into the locator. Dieter ----------------------------------------------------------------------- --- lib/python/App/ImageFile.py~ Fri May 28 17:49:25 1999 +++ lib/python/App/ImageFile.py Sat Nov 18 12:21:44 2000 @@ -123,6 +123,7 @@ def index_html(self, REQUEST, RESPONSE): """Default document""" RESPONSE.setHeader('Content-Type', self.content_type) + RESPONSE.setHeader('Last-Modified', self.lmh) f=open(self.path,'rb') data=f.read() f.close() --- lib/python/App/Common.py~ Fri Nov 17 23:36:49 2000 +++ lib/python/App/Common.py Sat Nov 18 12:31:18 2000 @@ -126,7 +126,7 @@ # useless. klm 11/13/2000. if ts is None: ts=time.time() year, month, day, hh, mm, ss, wd, y, z = time.gmtime(ts) - return "%s, %02d-%3s-%4d %02d:%02d:%02d GMT" % (weekday_abbr[wd], + return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (weekday_abbr[wd], day, monthname[month], year, hh, mm, ss)
participants (2)
-
Dieter Maurer -
The Doctor What