[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/HTTP/Reference/Headers/Cache-Control [Back]  [Original]

Cache-Control - HTTP | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Cache-Control

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

Cache-Control , . : ,

Header type General header
Forbidden request header
CORS-safelisted response-header

In this article

, , . .

Cache-Control, HTTP .

Cache-Control: max-age=<seconds>
Cache-Control: max-stale[=<seconds>]
Cache-Control: min-fresh=<seconds>
Cache-Control: no-cache
Cache-Control: no-store
Cache-Control: no-transform
Cache-Control: only-if-cached

Cache-Control, HTTP .

Cache-Control: must-revalidate
Cache-Control: no-cache
Cache-Control: no-store
Cache-Control: no-transform
Cache-Control: public
Cache-Control: private
Cache-Control: proxy-revalidate
Cache-Control: max-age=<seconds>
Cache-Control: s-maxage=<seconds>

Cache-Control

Cache-Control , HTTP. , .

Cache-Control: immutable
Cache-Control: stale-while-revalidate=<seconds>
Cache-Control: stale-if-error=<seconds>

public

, .

private

, . .

no-cache

.

only-if-cached

. .

max-age=<seconds>

. Expires, .

s-maxage=<seconds>

max-age Expires, (, ) .

max-stale[=<seconds>]

, , . , , .

min-fresh=<seconds>

, , .

stale-while-revalidate=<seconds>

, , . , .

stale-if-error=<seconds>

...

must-revalidate

. .

proxy-revalidate

, must-revalidate, (, ) .

immutable

Indicates that the response body will not change over time. The resource, if unexpired, is unchanged on the server and therefore the client should not send a conditional revalidation for it (e.g. If-None-Match or If-Modified-Since) to check for updates, even when the user explicitly refreshes the page. Clients that aren't aware of this extension must ignore them as per the HTTP specification. In Firefox, immutable is only honored on https:// transactions. For more information, see also this blog post.

no-store

no-transform

. Content-Encoding, Content-Range, Content-Type . , , . no-transform .

. . Expires Pragma.

bash
Cache-Control: no-cache, no-store, must-revalidate

, , . , , CSS JavaScript. . Expires.

bash
Cache-Control: public, max-age=31536000

Specification
HTTP Caching
# field.cache-control
HTTP Immutable Responses
# the-immutable-cache-control-extension


Web Proxy Viewer  |  New URL  |  Original Page