Using ETag and If-Modified-Since to Cut Origin Bandwidth and Crawl Waste
Every time a feed reader, API client, or search crawler re-fetches an unchanged HTML document and receives a full 200 OK payload, both sides pay for serialization, compression, and egress bytes that carried zero new information. Conditional HTTP requests solve this cleanly with ETag and Last-Modified headers.
How the Handshake Works
When a server returns a resource with a stable validator, compliant clients store that token and send it back on subsequent polls:
GET /posts/mysql-finding-records-not-in-another-table.html HTTP/1.1 Host: ditherandbicker.com If-None-Match: "v2-9a41f0c" If-Modified-Since: Sun, 15 Nov 2026 12:00:00 GMT
If the content hash or modification timestamp still matches, the origin or edge node replies with 304 Not Modified and an empty body, freeing the client to keep its cached copy.
Strong vs. Weak ETags Behind Compression
A common pitfall with reverse proxies is gzip or Brotli re-compression on the fly. Because byte-for-byte compressed output differs from the uncompressed origin file, proxies often downgrade a strong ETag ("abc") to a weak ETag (W/"abc"). As documented in the MDN ETag specification, weak validators are still valid for If-None-Match cache revalidation even though they cannot be used for byte-range requests.
Takeaway for Static & Dynamic Sites
For static sites hosted on edge networks, content-addressed ETags are usually handled automatically. For dynamic APIs and database-backed blogs, computing a fast hash of the template version plus the row's updated_at timestamp lets your handler short-circuit before rendering HTML at all.