[web] stop looking at a request's Cache-Control header
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 20 Nov 2015 17:13:03 +0100
changeset 10848 e905c95ccdfb
parent 10847 ce5403611cbe
child 10849 79066409fdcf
[web] stop looking at a request's Cache-Control header As per RFC 7234 (HTTP 1.1 Caching): The "Cache-Control" header field is used to specify directives for caches along the request/response chain. CubicWeb is not a cache.
web/request.py
--- a/web/request.py	Thu Nov 19 17:50:48 2015 +0100
+++ b/web/request.py	Fri Nov 20 17:13:03 2015 +0100
@@ -724,12 +724,11 @@
         Some response cache headers may be set by this method.
         """
         modified = True
-        if self.get_header('Cache-Control') not in ('max-age=0', 'no-cache'):
-            # Here, we search for any invalid 'not modified' condition
-            # see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3
-            validators = get_validators(self._headers_in)
-            if validators: # if we have no
-                modified = any(func(val, self.headers_out) for func, val in validators)
+        # Here, we search for any invalid 'not modified' condition
+        # see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3
+        validators = get_validators(self._headers_in)
+        if validators: # if we have no
+            modified = any(func(val, self.headers_out) for func, val in validators)
         # Forge expected response
         if modified:
             if 'Expires' not in self.headers_out: