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.
Support stale-while-revalidate and stale-if-error
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.
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.
Merge remote-tracking branch 'origin/pr/189'