[web/httpcache] send weak ETags
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 09 Mar 2016 19:00:09 +0100
changeset 11193 966b9e4e1f72
parent 11192 ba952f509af6
child 11194 b6b00bb1e528
[web/httpcache] send weak ETags There's no way we can provide a strong validator in general (especially considering how ETags are generated by the current EtagHTTPCacheManager and EntityHTTPCacheManager). So mark our entity-tags as weak.
cubicweb/web/httpcache.py
--- a/cubicweb/web/httpcache.py	Fri Mar 04 12:17:58 2016 +0100
+++ b/cubicweb/web/httpcache.py	Wed Mar 09 19:00:09 2016 +0100
@@ -67,7 +67,7 @@
     def set_headers(self):
         req = self.req
         try:
-            req.set_header('Etag', '"%s"' % self.etag())
+            req.set_header('Etag', 'W/"%s"' % self.etag())
         except NoEtag:
             super(EtagHTTPCacheManager, self).set_headers()
             return