Access-Control-Max-Age vs Cache-Control

What is the difference between Access-Control-Max-Age and Cache-Control in the HTTP response header?

Access-Control-Max-Age:1728000
Cache-Control:max-age=21600, public

I have a feeling that they do not belong to the same thing, because often they appear together, and sometimes with different meanings.

If they both appear in the http header but contain different values, would that be true?

+4
source share
1 answer

What is the difference between Access-Control-Max-Age and Cache-Control in the HTTP response header?

These headers are used in different contexts and for different purposes:

  • Cache-Control used in a broad general context to indicate the maximum time period when a resource will be considered fresh.

  • Access-Control-Max-Age CORS. , . Access-Control-Allow-Methods Access-Control-Allow-Headers.

, . Cache-Control max-age= , Access-Control-Max-Age .

, , , .

, . , , . Cache-Control max-age , . Access-Control-Max-Age , , , .

http, , ?

, . Access-Control-Max-Age: 1728000 , (Firefox 24 (86400 ) Chromium 10 (600 )). Chromium 5 .

@Filippos:

, Access-Control-Max-Age () , HTTP OPTIONS. HTTP (RFC 7231) HTTP OPTIONS ( " OPTIONS " ), , , HTTP OPTIONS Access-Control-Max-

+9

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


All Articles