rfc-8246

HTTP Immutable Responses

P. McManus
date2017-09 streamIETF areawit wghttpbis statusPROPOSED STANDARD pages6 canonicalhttps://www.rfc-editor.org/rfc/rfc8246 doi10.17487/RFC8246
The immutable HTTP response Cache-Control extension allows servers to identify resources that will not be updated during their freshness lifetime. This ensures that a client never needs to revalidate a cached fresh resource to be certain it has not been modified.

Extracted elements (13)

design-rationale §2

The immutable extension carries no arguments and has no effect when present in a request, deliberately keeping the extension minimal: the binary presence or absence of the directive in a response is sufficient to convey the server's guarantee.

http

design-rationale §1

The immutable extension was motivated by the 'versioned URL' design pattern in which sub-resources are published at new URLs when updated, making conditional revalidation requests wasteful. Without immutable, user-driven reloads generate hundreds of 304 responses for sub-resources that have not changed.

http

interoperability-note §2.1

A proxy that uses the immutable extension to bypass conditional revalidation can choose whether to reply with a 304 or 200 response to its requesting client based on the request headers the proxy received.

http

normative-requirement §3 SHOULD

Clients SHOULD ignore the immutable extension for resources that do not provide a strong indication that the stored response size is correct, such as responses delimited by connection close.

http, security

normative-requirement §3 SHOULD

Clients SHOULD ignore the immutable extension from resources that are not part of an authenticated context such as HTTPS, because authenticated resources are less vulnerable to cache poisoning.

http, security

normative-requirement §2 SHOULD NOT

Clients SHOULD NOT issue a conditional request during an immutable response's freshness lifetime (e.g., upon a reload) unless explicitly overridden by the user (e.g., a force reload).

http

normative-requirement §3 SHOULD

Force-reload mechanisms, typically indicated through no-cache request attributes, SHOULD ignore the immutable extension, to allow users to rectify interrupted loads and cache corruption.

http, security

normative-requirement §2 MUST

If any arguments are present on the immutable extension, they have no meaning and MUST be ignored. The presence of an immutable Cache-Control extension in a request has no effect.

http

normative-requirement §2.1 SHOULD

Proxies SHOULD skip conditionally revalidating fresh responses containing the immutable extension unless there is a signal from the client that a validation is necessary (e.g., a no-cache Cache-Control request directive).

http

normative-requirement §2 SHOULD

Stale responses marked immutable SHOULD be revalidated as they normally would be in the absence of the immutable extension; the extension only applies during the freshness lifetime.

http

protocol-element §2

The `immutable` Cache-Control response extension indicates that the origin server will not update the representation of that resource during the freshness lifetime of the response. It takes no arguments; any arguments present have no meaning. Multiple instances are equivalent to one instance.

http

registry §4

The `immutable` cache directive has been registered in the IANA 'Hypertext Transfer Protocol (HTTP) Cache Directive Registry' per the guidelines in Section 7.1 of RFC 7234, with reference RFC 8246.

http, registry

security-consideration §3

The immutable mechanism acts as a form of soft pinning and creates a vector for amplification of cache corruption incidents, including cache-poisoning attacks. Three mitigations are recommended: restricting to authenticated (HTTPS) contexts, honoring force-reload, and ignoring immutable for responses without a reliable size signal.

http, security