What does Cache-Control mean?
Cache -Control is an HTTP header used to specify browser caching policies in both Client requests and server responses. Policies include how a resource is cached, where it is cached, and the maximum age of the resource before it expires.
The most common Cache request directives and Cache response directives
How does it work?
The Cache-Control header is divided into directives, the most common of which are listed below:
Cache -Control: Max-Age
The max-age request directive defines in seconds how long it takes for a cached copy of a resource to expire. For example, Cache-control: max-age = 120 means that the returned resource is valid for 120 seconds.
Cache control: None Cache
The No-Cache directive means that a browser may cache a response, but must first send a verification request to an origin server.
Cache -Control: No-Store
The no-store directive means that browsers must not cache a response and must retrieve it from the server each time it is requested. This setting is typically used for sensitive data, such as personal banking information.
Cache -Control: Public
The public response statement specifies that a resource can be cached by any Cache.
Cache -Control: Private
The private response directive specifies that a resource is user-specific. It can still be cached, but only on a Clientdevice.
For more information and examples on the Cache-Control directive, click here:
Do you have any more questions?