web/httpcache.py
brancholdstable
changeset 5993 50e1a6ad3e98
parent 5867 7ef636d24ab2
child 8176 eff4fe02ec64
--- a/web/httpcache.py	Thu May 06 08:24:46 2010 +0200
+++ b/web/httpcache.py	Mon Jul 19 15:36:16 2010 +0200
@@ -15,10 +15,8 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
-"""HTTP cache managers
+"""HTTP cache managers"""
 
-
-"""
 __docformat__ = "restructuredtext en"
 
 from time import mktime
@@ -56,6 +54,8 @@
     """
 
     def etag(self):
+        if not self.req.cnx: # session without established connection to the repo
+            return self.view.__regid__
         return self.view.__regid__ + '/' + ','.join(sorted(self.req.user.groups))
 
     def max_age(self):
@@ -144,8 +144,5 @@
 # max-age=0 to actually force revalidation when needed
 viewmod.View.cache_max_age = 0
 
-
-viewmod.EntityView.http_cache_manager = EntityHTTPCacheManager
-
 viewmod.StartupView.http_cache_manager = MaxAgeHTTPCacheManager
 viewmod.StartupView.cache_max_age = 60*60*2 # stay in http cache for 2 hours by default