Return a valid 1xx warning header value describing the cache adjustments. The response is provided too allow warnings like 113 http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need to explicitly say response is over 24 hours old.
(self, response: HTTPResponse)
| 26 | |
| 27 | class BaseHeuristic: |
| 28 | def warning(self, response: HTTPResponse) -> str | None: |
| 29 | """ |
| 30 | Return a valid 1xx warning header value describing the cache |
| 31 | adjustments. |
| 32 | |
| 33 | The response is provided too allow warnings like 113 |
| 34 | http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need |
| 35 | to explicitly say response is over 24 hours old. |
| 36 | """ |
| 37 | return '110 - "Response is Stale"' |
| 38 | |
| 39 | def update_headers(self, response: HTTPResponse) -> dict[str, str]: |
| 40 | """Update the response headers with any new headers. |