Skip to content

Commit

Permalink
gateway: document If-Modified-Since
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Mar 27, 2024
1 parent d1d6c15 commit 5a08fc1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/http-gateways/path-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ All request headers are optional.

### `If-None-Match` (request header)

Used for HTTP caching.
Optional, used for HTTP caching.

Enables advanced cache control based on `Etag`,
allowing client and server to skip data transfer if previously downloaded
Expand All @@ -123,6 +123,22 @@ The Gateway MUST compare Etag values sent in `If-None-Match` with `Etag` that
would be sent with response. Positive match MUST return HTTP status code 304
(Not Modified), without any payload.

### `If-Modified-Since` (request header)

Optional, used for HTTP caching of mutable resources.

Enables advanced cache control based on `Last-Modified`,
allowing client and server to skip data transfer if previously downloaded
payload did not change.

The Gateway SHOULD compare HTTP-date value sent in `If-Modified-Since` with `Last-Modified` that
would be sent with response. Positive match MUST return HTTP status code 304
(Not Modified), without any payload.

While `Last-Modified` SHOULD be implemented by the gateway itself,
implementation and handling of this header MAY be delegated to a third-party
HTTP software such as CDN, reverse proxy, or load-balancer.

### `Cache-Control` (request header)

Used for HTTP caching.
Expand Down Expand Up @@ -272,6 +288,12 @@ Indicates permanent redirection.

The new, canonical URL is returned in the [`Location`](#location-response-header) header.

### `304` Not Modified

Indicates indicates that there is no need to retransmit the requested resources.

See: [`Last-Modified`](#last-modified-response-header).

### `400` Bad Request

A generic client error returned when it is not possible to return a better one
Expand Down
4 changes: 4 additions & 0 deletions src/http-gateways/trustless-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Same as in :cite[path-gateway], but with limited number of supported response ty

## Request Headers

For HTTP Caching, follow `Cache-Control`, `If-Modified-Since`, and `If-None-Match` from :cite[path-gateway].

### `Accept` (request header)

A Client SHOULD send this HTTP header to leverage content type negotiation
Expand Down Expand Up @@ -189,6 +191,8 @@ Below MUST be implemented **in addition** to "HTTP Response" of :cite[path-gatew

## Response Headers

For HTTP Caching, follow `Cache-Control`, `Last-Modified`, and `Etag` from :cite[path-gateway].

### `Content-Type` (response header)

MUST be returned and include additional format-specific parameters when possible.
Expand Down

0 comments on commit 5a08fc1

Please sign in to comment.