CVS: Products/Basket - resource.py:1.3

Chris McDonough <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
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)

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.