Home > Backend Development > PHP Tutorial > PHP knowledge point 3-HTTP header-Cache-Control

PHP knowledge point 3-HTTP header-Cache-Control

WBOY
Release: 2016-07-28 08:27:04
Original
1146 people have browsed it

1. Overview
Cache-control is used to control HTTP cache (may not be partially implemented in HTTP/1.0, only Pragma: no-cache is implemented)
2. Example
Cache-Control: cache-directive
cache-directive can For the following:
request is used:
no-cache
no-store
max-age = delta-seconds
max-stale = delta-seconds
min-fresh = delta-seconds
no-transform"
only-if -cached"
cache-extension"
response is used:
public
private = <> field-name <">
no-cache = field-name
no-store"
no-transform
must -revalidate
proxy-revalidate
max-age = delta-seconds
s-maxage = delta-seconds
cache-extension"
3. Analysis
Cache-control: max-age=5
means 5 after visiting this webpage Accessing again within seconds will not go to the server
Cache-Control: no-cache: This can easily cause misunderstanding, making people mistakenly think that the response is not cached.
In fact, Cache-Control: no-cache will be cached, but every time when response data is provided to the client (browser),
the cache must evaluate the validity of the cached response to the server.
Cache-Control: no-store: This means that the response is not cached.

The above introduces PHP knowledge point 3-HTTP header-Cache-Control, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template