Support stale-while-revalidate and stale-if-error #189

merged 1 commit into from Apr 4, 2015


None yet

2 participants

dstufft commented Mar 28, 2015

These supports the RFC 5861 extensions to cache control which allow a site to tell a HTTP cache that it's acceptable to serve a stale response while re-validating the currently cached response (stale-if-revalidate) and that it's acceptable to serve a stale response if an error occurs (stale-if-error). These both take a number of seconds for which it is acceptable to serve a stale response for.

I didn't write any tests because there doesn't seem to be any that exercise all of the various header options, if this needs tests let me know.

@bertjwregeer bertjwregeer added this to the Version 1.5 milestone Apr 1, 2015

Thanks :-).

Tests will need to be written eventually for all of the header options, just to make sure that as I start making changes I don't break anything.

dstufft commented Apr 1, 2015

Do you want me to add them to this PR for these headers or would you prefer to just do them all at the same time?


If you have the time to add tests and think you know where it is appropriate to add them, it is less work I have to do later. I was mainly adding it as a mental note on this PR for myself.

@bertjwregeer bertjwregeer merged commit a047793 into Pylons:master Apr 4, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@bertjwregeer bertjwregeer added a commit that referenced this pull request Apr 4, 2015
@bertjwregeer bertjwregeer Merge remote-tracking branch 'origin/pr/189'
Closes #189


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment