What HTTP status codes can be cached?

As indicated in the header, which HTTP status codes are acceptable for caching as a browser? I did a quick search and did not find an authoritative answer.

Initially, I thought that these could only be 200OK answers , but I could not find any evidence to support this idea.

+4
source share
2 answers

Short answer

In accordance with RFC 7231 , the current reference for the content and semantics of the HTTP / 1.1 protocol, the following HTTP status codes are defined as unless otherwise specified by a method definition or explicit cache controls

RFC 7231 HTTP, :

6.1.

[...] ,   (, 200, 203, 204, 206, 300, 301, 404, 405, 410, 414 501    )       ;    . [...]

HTTP , - :

6.

- ,    .

HTTP . HTTP    ,   , , .    ,       x00 , , a    . [...]

HTTP:

4.2.3.

"", ,    . , ,    ,   ; GET, HEAD POST   , -    GET HEAD.

POST :

4.3.3. POST

[...] POST ,    [...]

. .

+10

RFC7234, , , 200 (OK):

[...]         , 200 (OK) GET,     ,    ( 4.3.1 [RFC7231]).    - , (, 404 ( )), (, 206 ( ))    , GET,     - -.

, .

0

Source: https://habr.com/ru/post/1654056/


All Articles