Cache Validation Headers ETag, If-None-Match

129 단어·1 분·원문(.md)

ETag and If-None-Match validation headers offer a simpler approach than Last-Modified and If-Modified-Since.

ETag can be used when the server wants to fully control caching.

How it Works #

The server responds by writing the ETag in the header.

The client's cache stores that ETag value.

If the cache has expired and a new request needs to be made, the client sends an If-None-Match header with the ETag value for validation in the request header (conditional request).

If the data on the server has not changed, the ETag remains the same, making If-None-Match false.

In this case, the server responds with 304 Not Modified, and there is no HTTP body.

The browser cache reuses the response result and updates the header data.

Summary #

Back-End/Internet/etag.md