[Zope-CVS] CVS: Products/Basket - resource.py:1.3

Chris McDonough chrism at plope.com
Wed Nov 9 16:26:54 EST 2005


Update of /cvs-repository/Products/Basket
In directory cvs.zope.org:/tmp/cvs-serv24139

Modified Files:
	resource.py 
Log Message:
Set self.cch so index_html doesn't bomb.

Move the setting of path up a little so it gets stuffed into the proper places.


=== Products/Basket/resource.py 1.2 => 1.3 ===
--- Products/Basket/resource.py:1.2	Tue Nov  8 23:24:18 2005
+++ Products/Basket/resource.py	Wed Nov  9 16:26:53 2005
@@ -111,6 +111,14 @@
             self.lmt=time.time()
         self.lmh=rfc1123_date(self.lmt)
 
+        if DevelopmentMode:
+            # In development mode, a shorter time is handy
+            max_age = 60 # One minute
+        else:
+            # A longer time reduces latency in production mode
+            max_age = 3600 # One hour
+        self.cch = 'public,max-age=%d' % max_age
+
     def read(self):
         return pkg_resources.resource_string(self.module, self.path)
 
@@ -162,11 +170,11 @@
         self.ZBindings_edit(defaultBindings)
         self._setFuncSignature()
 
+        path = path + '.dtml'
+
         #from ClassicHTMLFile.__init__(self, name, _prefix, **kw)
         if not kw.has_key('__name__'):
             kw['__name__'] = os.path.basename(path)
-
-        path = path + '.dtml'
 
         #from FileMixin.__init__(self, *args, **kw)
         self.raw = (module, path)



More information about the Zope-CVS mailing list