Cache-Control (General Header, HTTP 1.1)

  
.private (response header only) Response: Tells the cacher (as far as I know, it refers to the user agent, the local cache of common browsers. The user also refers to the system Users. But perhaps, it should not be excluded, some gateways can identify each end user's situation), only cache responses for individual users. And can specify a certain field. For example, private –“username”, response header In the middle, the header content named username will not be shared by the cache..no-cache: Request: Inform the cacher that the original request must be forwarded and any cacher should be notified. Do not take the cached copy directly, fooling people. You need to forward my request and verify your cache (if any). Correspondence noun: end-to-end overload. Response: Allow the cache to cache the copy. Then the actual value is that the cache is always forced. Check the freshness of the cache. Once the confirmation is fresh, you can use the cached copy as a response. No-cache, you can also specify a containing field, such as a typical application, no-cache=Set-Cookie. The result of this is Tell the cacher, For the Set-Cookie field, you should not use the cached content. Instead, use the new drop. Other content can use the cache..no-store: request: inform, request and response are prohibited from being cached. (maybe for privacy reasons) Response: Same as above: max-age: Request: Force response to the cacher, according to the value, check the freshness. That is, compare with the own Age value and the request time. If the max-age value is exceeded, force to the server side. Verify. To ensure a fresh response is returned. Its functionality is essentially similar to traditional Expires, but the difference is that Expires is based on a specific date value. Once the cacher's own time is inaccurate, the result may be wrong. And max-age, obviously no such problem. Max-age priority is also higher than Expires. Response: similar to the above, but the issuer is different.. max-stale: request: meaning, I allow the cacher, Send a stale cache that expires no more than the specified number of seconds. Response: Same as above..must-revalidate (response header only) Response: This means that if the cache has passed the fresh period, it must be re-verified instead of trying Return a cache that is not in the fresh period. With no-cach The difference between e is that no-cache completely ignores the concept of fresh period. It always forces re-verification. In theory, must-revalidate saves traffic, but compared to no-cache, it may not always be so accurate. Because even if it is cached It is considered fresh, and there is no guarantee that the server has not been updated. If the cache is a cache proxy, if it fails to connect to the original server when it tries to re-authenticate, it is not allowed to return a cache that is not fresh. In the copy, it must return a 504 Gateway timeout..proxy-revalidate (response header only) response: the limit is similar to must-revalidate. The difference is the scope of the receptor. proxy-revalidate, to exclude the user The cache of the proxy. That is, its rules are not applied to the local cache of the user agent..min-fresh (request header only) Request: Tell the cacher that if the current time plus the value of min-fresh is exceeded The expiration time of the cache. Give me a new one. In fact, I personally think that its function is a bit similar to max-age. But the bigger one is the semantic difference: only-if-cached: (only request flag Head) request: tell the cacher, me I want the content to come from the cache, I don't care about the cached response, whether it is fresh..s-maxage (response header only) response: The only difference from max-age is that s-maxage is only applied to the shared cache. Does not refer to the local cache of the user agent, etc. for single-user cache. In addition, s-maxage has a higher priority than max-age..cache-extension (cache-extension is a generalized name. It refers to all self Definition, or extended, directive, client and server can customize the Cache-Control related instructions.) So, in fact, we can do this Cache-Control: max-age=300, custom-directive = xxx, Public. So we define an extension directive called cache-extension. If the corresponding client or server does not know, it will ignore..no-transform request: tell the proxy, do not change the media type. , such as jpg, was changed to png. Response: Same as above.
Copyright © Windows knowledge All Rights Reserved