PLAIN/TEXT — ISSUE 141/456 COMPUTER SCIENCE · FOUNDATION / CONDITIONAL REQUESTS · ~4 MIN READING DATE: 2027-02-19 ARCHIVE: https://plaintext.click/newsletter/ SUBJECT: How a website says “your copy is still current” How a website says “your copy is still current” =============================================== / START HERE Your browser may already hold yesterday’s copy of a document but need to know whether it changed. A conditional request asks the computer serving a web item to perform an action only when a stated test about that item passes. For a download, the test can avoid sending the whole document when the existing copy is still suitable. / WHY NOW This is more precise than either “download again” or “trust the old copy forever”. The browser asks a small question about the version it already has. / THE IDEA HTTP is the set of request-and-response rules used for ordinary web communication. A resource is an item identified by a web address. A representation is the particular content form being returned, such as an English-language document. A server can attach an entity tag, usually written ETag, to that representation. The tag is an identifier the server chooses for comparison. Later, the browser sends a GET request, meaning retrieve this resource, with If-None-Match containing its stored tag. If the selected representation matches, the server returns status 304, Not Modified, rather than a replacement content body. If it does not match, a normal successful response can carry the new content and a new tag. / THE FORMAL IDEA GET + If-None-Match: "v7" → compare current ETag - The quoted v7 is a toy opaque identifier: clients must not assume it is a version number they can increment. - GET, If-None-Match and 304 are HTTP names. A response body is the actual document content, separate from the response’s descriptive headers. / RUN THE TINY EXAMPLE Change one thing. Predict what happens. Browser holds a 200 kB document with ETag "v7"; the server still selects "v7". Conditional GET receives 304, so no replacement 200 kB body is transferred. Change one input: the server selects a changed document tagged "v8". The tags differ, so the server returns the new body with its new ETag instead. The first answer validates reuse; it does not mean the server returned an empty document for the browser to display. The browser still needs the stored body. In the second answer, the extra bytes are useful because the old copy no longer matches. / SO WHAT? A successful validation still requires communication. It saves content transfer, not every network wait. When examining browser traffic, a 304 response can therefore be evidence of a functioning version check rather than a broken download. It also explains why repeatedly checking an unchanged large document may use little body traffic while still creating requests for the server to evaluate. / ONE CAVEAT Entity tags can be weak or strong and are not necessarily cryptographic hashes. Representation selection and correct server tagging matter; a conditional request is only as meaningful as the comparison being maintained. / KEEP THIS A version comparison can replace a full download when the server confirms that the body already held is still suitable. / SOURCE TRAIL [1] IETF — HTTP entity tags and If-None-Match https://www.rfc-editor.org/rfc/rfc9110.html NEXT: Why adding water raises the note of a blown bottle --- HARD IDEAS. PLAIN TEXT. You are receiving this because you asked for one clear computer-science or physics idea each day. Unsubscribe: https://plaintext.click/unsubscribe View in browser: https://plaintext.click/newsletter/2027/02/2027-02-19-http-etag-conditional.html From: Plain/Text / Brickston Consulting · 30 N Gould St Ste N, Sheridan, WY 82801 US · knowledge@plaintext.click