When a user accesses a website, the browser caches web resources after the first load to reduce the server pressure and speed up the second load.
Refer to the article
1. Practice this one and thoroughly understand the browser caching mechanism
2. HTTP cache – MDN
3. If the ETag value in the HTTP response header changes, does that mean that the file content must have changed #113
Noun explanation
memory cache
: cache to memory, browser closed after the next need to reloaddisk cache
: Cache to disk, browser closed and then open cache is also effectiveCache-Control: max-age=30
Cache expiration timeno-cache
/max-age=<seconds>
Detailed introductionDate: Mon, 26 Apr 2021 16:49:50 GMT
The time point at which the current resource server responds is converted to China time zone plus 8 hoursETag: "6084338b-c7"
The ETag of the current file will be modified after the file is modified, but the file will not be modifiedLast-Modified
Modification can also lead toETag
Change, see reference article 3Last-Modified: Sat, 24 Apr 2021 15:04:43 GMT
Time when the file was last modifiedServer: nginx / 1.18.0
Server Type
Nginx simple configuration
server { listen 8089; location / { add_header Cache-Control max-age=100,immutable; root D:/soft/qq/Desktop/0820/HTML/nginx; }}Copy the code