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

fix(gateway): clarify cache-control of generated html on /ipfs #480

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/http-gateways/path-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,19 @@ Returned directive depends on requested content path and format:

- `Cache-Control: public, max-age=29030400, immutable` MUST be returned for
every immutable resource under `/ipfs/` namespace.
- Generated `/ipfs/` responses such as UnixFS directory listings are not
byte-for-byte immutable and SHOULD have a meaningful expiration that allows
for generated responses to be updated over time. Suggested value is one week:
`public, max-age=604800, stale-while-revalidate=2678400`.

- `Cache-Control: public, max-age=<ttl>` SHOULD be returned for mutable
- `Cache-Control: public, max-age=<ttl>, stale-while-revalidate=2678400` SHOULD be returned for mutable
resources under `/ipns/{id-with-ttl}/` namespace; `max-age=<ttl>` SHOULD
indicate remaining TTL of the mutable pointer such as :cite[ipns-record] or DNSLink
TXT record.
- Implementations MAY place an upper bound on any TTL received, as
noted in Section 8 of :cite[rfc2181].
- If TTL value is unknown, implementations SHOULD not send a `Cache-Control`
- If TTL value is unknown, implementations MAY send a best-effort `Cache-Control`
informing caches and CDNs how long a stale response is acceptable.
- No matter if TTL value is known or not, implementations SHOULD always
send a [`Last-Modified`](#last-modified-response-header) header with the timestamp of the record resolution.

Expand Down
Loading