Open
Description
There are two ways HTTP servers (incl. HTTP gateway responses for /ipns
paths) may support update checks: via Etag
or Last-Modified
headers. We could improve HTTPSubscriber
to maximize cache hits, and if Etag
or Last-Modified
are present in the response, store them, and use in follow-up update checks:
- if
Etag
was present, check for update withIf-None-Match
- if
Etag
was not present, butLast-Modified
was present, check for update withIf-Modified-Since
- (we prefer If-None-Match, because Etags are more deterministic than time-based check)
This is a bit nicer because if the content did not change since the last check, the response will be HTTP 304 Not Modified without any payload, rather than HTTP 5XX error, and will be produced by edge cache/cdn, rather than hitting the backend every time.