ETags identify resource representations for conditional requests. Revalidation can avoid transferring an unchanged body; preconditions can also protect updates.
Before you start
You should understand clients, servers, IP addresses and ports. Follow a request through name resolution, connection establishment and application exchange. Distinguish protocol guarantees from deployment policy, and use observations from the relevant layer rather than guessing from one browser error message.
The practical goal is to reason through this situation: A client sends If-None-Match for a cached representation and handles an unchanged response. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Identify the representation
The ETag must correspond to the actual selected content.
Step 2: Revalidate cached reads
If-None-Match can avoid resending an unchanged body.
Step 3: Protect conditional writes
Server-enforced If-Match can reject stale edits.
Worked scenario
A client sends If-None-Match for a cached representation and handles an unchanged response.
Editors A and B load representation tag v1. A saves and the tag becomes v2. B’s write with If-Match:v1 fails its precondition instead of replacing A’s changes. Revalidation savings and update-conflict prevention use related conditional-request machinery but require different request conditions and response handling.
Common mistake
An ETag must correspond to the representation being validated.
Verify the behavior
Test unchanged read, changed read and stale conditional update.
Interview exercise
Prevent a lost update.
Answer and reasoning
Use an appropriate If-Match precondition with server enforcement and report conflicts rather than overwriting a changed resource.
Continue learning
Compare the scenario with the Networking interview questions and test your understanding with the Networking MCQs. For terminology and implementation details, consult the reference material.