You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fixed stale-while-revalidate window let caches reuse an IPNS record
past its Validity (EOL). After EOL the signature is expired, so
validating clients reject the record, which surfaced as sporadic 500s
in the service-worker gateway. Mirror the bound applied in
ipfs/boxo#1166: max-age plus the stale window must end before the EOL,
and an already-expired record must not be cached.
- path-gateway: keep a fixed stale window for generated /ipfs/ HTML
(content-addressed, no EOL), but cap the mutable /ipns/ window to the
record's remaining validity; no-store past EOL
- http-routing-v1: size the ipns record stale window as remaining
validity minus max-age so it ends at the EOL; no-store when the
record is expired or its ValidityType is unrecognized
Copy file name to clipboardExpand all lines: src/routing/http-routing-v1.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: >
4
4
Delegated routing is a mechanism for IPFS implementations to use for offloading
5
5
content routing, peer routing and naming to another process/server. This specification describes
6
6
an HTTP API for delegated routing of content, peers, and IPNS.
7
-
date: 2025-12-17
7
+
date: 2026-06-15
8
8
maturity: reliable
9
9
editors:
10
10
- name: Marcin Rataj
@@ -232,9 +232,11 @@ Each object in the `Peers` list is a record conforming to the [Peer Schema](#pee
232
232
#### Response Headers
233
233
234
234
-`Etag`: a globally unique opaque string used for HTTP caching. MUST be derived from the protobuf record returned in the body.
235
-
-`Cache-Control: public, max-age={ttl}, public, stale-while-revalidate={sig-ttl}, stale-if-error={sig-ttl}`: meaningful cache TTL returned with :ref[IPNS Record]
236
-
- The `max-age` value in seconds SHOULD match duration from `IpnsEntry.data[TTL]`, if present and bigger than `0`. Otherwise, implementation SHOULD default to `max-age=60`.
237
-
- Implementations SHOULD include `sig-ttl`, set to the remaining number of seconds the returned IPNS Record is valid.
235
+
-`Cache-Control: public, max-age={ttl}, stale-while-revalidate={stale}, stale-if-error={stale}`: cache lifetime for the returned :ref[IPNS Record].
236
+
- An IPNS Record with `ValidityType=0` is valid only until its EOL, the `Validity` timestamp. A cache that reuses the record past the EOL serves a record that fails validation, so the entire cache lifetime MUST stay within the remaining validity.
237
+
-`{ttl}` (the `max-age`) SHOULD match `IpnsEntry.data[TTL]` in seconds, or default to `60` when `TTL` is absent or `0`. Either way, cap it to the remaining validity.
238
+
-`{stale}` SHOULD be the remaining validity minus `max-age`, so `max-age` plus the stale window ends at the EOL and never crosses it.
239
+
- Return `Cache-Control: no-store` instead when the record is already expired, or when its `ValidityType` is unrecognized and the EOL is therefore unknown.
238
240
-`Expires:`: an HTTP-date timestamp ([RFC9110, Section 5.6.7](https://www.rfc-editor.org/rfc/rfc9110#section-5.6.7)) when the validity of IPNS Record expires (if `ValidityType=0`, when signature expires)
239
241
-`Last-Modified`: an HTTP-date timestamp of when cacheable resolution occurred: allows HTTP proxies and CDNs to support inexpensive update checks via `If-Modified-Since`
240
242
-`Vary: Accept`: allows intermediate caches to play nicely with the different possible content types.
0 commit comments