-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
# Since Expires has resolution in seconds, do not use cache_expires | ||
# in order to omit it. | ||
response.cache_control.no_cache = True | ||
response.pragma = 'no-cache' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think pragma
is a response header, even in HTTP/1.0 it was only a request header, right? See http://stackoverflow.com/a/15050018/680454
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, oh. To be honest, I just had a look at the underlying http library of the Pyramid framework, and copied this :) https://github.com/Pylons/webob/blob/master/webob/response.py#L953
I will remove it, and update the tests, thanks!
bead02d
to
4c43a85
Compare
@michielbdejong I updated the PR with your suggestion (getting rid of Pragma response header, and rebasing on the cache restricted to anonymous requests) @Natim any feedback ? |
resp = self.app.get('/moistures') | ||
self.assertIn('no-cache', resp.headers['Cache-Control']) | ||
self.assertNotIn('Expires', resp.headers) | ||
self.assertNotIn('Pragma', resp.headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this, since it is not a feature to not have them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it sorry for the noise
It looks good to me apart from the Pragma thing. |
Do you think we should put some Pragma response header ? |
4d97c7f
to
0b6a88b
Compare
0b6a88b
to
9f8fffd
Compare
…default Add no-cache headers by default
Fix the Dockerfile: install pip from apt
(ref Kinto/kinto#231)