Designing ETag validators that survive compression
RFC 9110 requires strong entity tags to change whenever the representation body changes byte-for-byte, including across gzip and brotli encodings. Reusing an uncompressed hash on a compressed response breaks byte-range resume.
Compute validators per representation or append an encoding suffix when transforming on the fly. When a client sends If-None-Match, compare against the exact variant that would be served.
Pair short max-age directives on HTML documents with immutable content-hashed URLs for stylesheets and icons. Readers see updates within minutes while repeat page views avoid redundant asset transfers.
Verify 304 Not Modified responses in automated checks to ensure cache headers and validators stay aligned across server upgrades.