[Zope-Checkins] CVS: Zope2 - AcceleratedHTTPCacheManager.py:1.4.6.2

Brian Lloyd brian@digicool.com
Tue, 10 Apr 2001 10:31:34 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/Products/StandardCacheManagers
In directory korak:/home/brian/temp/zope-23-branch/lib/python/Products/StandardCacheManagers

Modified Files:
      Tag: zope-2_3-branch
	AcceleratedHTTPCacheManager.py 
Log Message:
Fixed use of locale-dependent http date



--- Updated File AcceleratedHTTPCacheManager.py in package Zope2 --
--- AcceleratedHTTPCacheManager.py	2001/02/12 15:35:45	1.4.6.1
+++ AcceleratedHTTPCacheManager.py	2001/04/10 14:31:32	1.4.6.2
@@ -98,12 +98,9 @@
 import urlparse, httplib
 from urllib import quote
 from string import lower, join, split
+from App.Common import rfc1123_date
 
 
-def http_date(value, format='%a, %d %b %Y %H:%M:%S GMT'):
-    return time.strftime(format, time.gmtime(value))
-
-
 class AcceleratedHTTPCache (Cache):
     # Note the need to take thread safety into account.
     # Also note that objects of this class are not persistent,
@@ -173,8 +170,8 @@
             return
         # Set HTTP Expires and Cache-Control headers
         seconds=self.interval
-        expires=http_date(time.time() + seconds)
-        # RESPONSE.setHeader('Last-Modified', http_date(time.time()))
+        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)