Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPSubscriber: check with If-None-Match or If-Modified-Since #38

Open
Tracked by #126 ...
lidel opened this issue Apr 22, 2024 · 0 comments
Open
Tracked by #126 ...

HTTPSubscriber: check with If-None-Match or If-Modified-Since #38

lidel opened this issue Apr 22, 2024 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Apr 22, 2024

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 with If-None-Match
  • if Etag was not present, but Last-Modified was present, check for update with If-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant