Learn VisualLearn API

Ask Whether It Changed Instead of Fetching It Again

An ETag is a value the server attaches to a response. Its contents carry no meaning; it identifies the resource's version at that moment.

When a stored response becomes stale, the client revalidates it by sending that ETag back to the server in an If-None-Match header. If the ETag still matches, the server returns 304 Not Modified with no body, and the client keeps using its stored copy. If the resource has changed, the server returns a normal 200 with the new body and a new ETag.

Either way, the client can tell whether to keep or replace its stored copy. With a 304, it also saves the cost of sending a body the client already has.

GOAL

Trace an ETag-based revalidation exchange, and explain when it returns 304 versus a fresh 200 body.

A client sends If-None-Match: "abc123" and the resource's current ETag is still "abc123". What does the server return?