From 56de6ec6d1e54342be7f380b7e6a52f41e881aca Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 5 Sep 2023 13:07:37 +0200 Subject: [PATCH 1/2] gateway: clean Cache-Control and Last-Modified --- src/http-gateways/path-gateway.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/http-gateways/path-gateway.md b/src/http-gateways/path-gateway.md index c2e80bc77..326d62183 100644 --- a/src/http-gateways/path-gateway.md +++ b/src/http-gateways/path-gateway.md @@ -370,17 +370,17 @@ in caches. Returned directive depends on requested content path and format: -- `Cache-Control: public, max-age=29030400, immutable` must be returned for +- `Cache-Control: public, max-age=29030400, immutable` MUST be returned for every immutable resource under `/ipfs/` namespace. -- `Cache-Control: public, max-age=` should be returned for mutable - resources under `/ipns/{id-with-ttl}/` namespace; `max-age=` should - indicate remaining TTL of the mutable pointer such as IPNS record or DNSLink +- `Cache-Control: public, max-age=` SHOULD be returned for mutable + resources under `/ipns/{id-with-ttl}/` namespace; `max-age=` 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 set it to a static - value, but it SHOULD not be lower than 60 seconds. + - If TTL value is unknown, implementations SHOULD not send a `Cache-Control` + header and instead send a [`Last-Modified`](#last-modified-response-header) header. ### `Last-Modified` (response header) From 1148af2e35dd1854b40366628579f194a26de8b9 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 7 Sep 2023 09:37:42 +0200 Subject: [PATCH 2/2] chore: apply feedback suggestions Co-authored-by: Marcin Rataj --- src/http-gateways/path-gateway.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http-gateways/path-gateway.md b/src/http-gateways/path-gateway.md index 326d62183..15d7d35c3 100644 --- a/src/http-gateways/path-gateway.md +++ b/src/http-gateways/path-gateway.md @@ -380,7 +380,8 @@ Returned directive depends on requested content path and format: - 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` - header and instead send a [`Last-Modified`](#last-modified-response-header) header. + - 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. ### `Last-Modified` (response header)