91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

Expires, Last-Modified, Etag緩存機制

小云
102
2023-09-19 07:22:37
欄目: 編程語言

Expires, Last-Modified, and Etag are all mechanisms used for caching in web browsers.

  1. Expires: The Expires header specifies a date and time after which the cached resource is considered expired and should no longer be used. The browser checks the Expires header before making a request to the server, and if the current date and time is later than the specified date and time, it sends a request to the server to get the latest version of the resource. This mechanism is based on the assumption that the resource will not change before the specified expiration date.

  2. Last-Modified: The Last-Modified header is sent by the server in response to a request for a resource. It contains the date and time when the resource was last modified. When the browser receives this header, it stores the date and time. The next time the browser needs to fetch the same resource, it sends a request to the server with an If-Modified-Since header containing the stored date and time. If the resource has not been modified since the specified date and time, the server responds with a 304 Not Modified status code and the browser uses the cached version of the resource. Otherwise, the server sends the updated version of the resource.

  3. Etag: The Etag (entity tag) header is another way for the server to identify a specific version of a resource. It is typically a hash or a unique identifier generated by the server based on the resource’s content. Similar to the Last-Modified header, when the browser receives the Etag header, it stores the value. The next time the browser needs to fetch the same resource, it sends a request to the server with an If-None-Match header containing the stored Etag value. If the Etag value matches the current version of the resource on the server, the server responds with a 304 Not Modified status code and the browser uses the cached version. If the Etag value does not match, the server sends the updated version of the resource.

Both Last-Modified and Etag are used to validate whether the cached version of a resource is still valid, but they have different approaches. Last-Modified relies on the server’s timestamp of the resource’s last modification, while Etag relies on a unique identifier generated by the server.

0
三明市| 禄劝| 沿河| 东乌珠穆沁旗| 武鸣县| 鹤山市| 南阳市| 沂源县| 辽中县| 乡城县| 增城市| 门头沟区| 彩票| 石首市| 镶黄旗| 潼关县| 闵行区| 和静县| 宜兴市| 孟州市| 甘谷县| 南涧| 天镇县| 泗水县| 甘孜县| 静海县| 长沙市| 翁源县| 英山县| 大新县| 许昌市| 宿松县| 安图县| 神池县| 馆陶县| 宣武区| 华阴市| 麻城市| 武平县| 乌鲁木齐市| 扶风县|