1, ETag and expires the client-side HTTP Request header and server-side HTTP reponse Header working principle.
2, static under the Apache, Lighttpd and Nginx ETag and expires configuration
3. ETag and expires processing in non-real-time
Syntax: Expires [TIME|EPOCH|MAX|PFF] Default: Offexpires Command controls the "expires" and "Cache-control" header header information in an HTTP response, and starts controlling the page cache for time: You can use positive or negative numbers. The
1. How the Client-side Http Request Header and Server-side Http Reponse Header work in Etag and Expires.
2. Static configuration of Etag and Expires in Apache, Lighttpd, and Nginx
3. Etag and Expires processing on dynamic pages with non-real-time
There are many kinds of caches: Server cache, third-party cache, browser cache, and so on. The browser cache is the least expensive, because the browser cache relies on the client and consumes little server-side resources.Making the browser cache
Response. Expires attributes (reproduced in the BLOG of crazy customers), response. expires
Expires attributes The Expires attribute specifies the time before the page cached on the browser Expires. If you return to this page before a page expires,
Browser cache, also known as HTTP cache, refers to when we browse the site, the browser will store a copy locally, so that the next time you visit the same URL can no longer connect to the server, directly from the browser local cache to obtain
One of the most important factors in front-end optimization is to set a long expiration time. For example, Yahoo expires is set to 10 years, and pageSpeed is recommended for more than one month. The purpose of setting expires is to prevent
Expires, Cache-control, last-modified, ETag are all in the return header of the HTTP response
Used to control the browser client cache behavior.
1.Expires is defined in http/1.0, cache-control:max-age=xxx is defined in http/1.1,
For backwards
Recently in the optimization of CDN, browser cache In-depth research, a note, to facilitate the post-comers
Drew a Sketch:
Detailed descriptions of each status are as follows:
1 , last-modified
When the browser first requests a URL, the
Both expires and max-age can be used to specify the expiration time of a document, but there are some minor differences1.Expires has been defined in the http/1.0, cache-control:max-age in http/1.1 is defined, in order to backward compatibility, only
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.