ETag + conditional GET for read-heavy endpoints

4641
0

For read-heavy endpoints, clients often fetch the same resource repeatedly (profile data, settings, a snip page) even when it hasn’t changed. ETags let the client send If-None-Match and the server respond with 304 Not Modified, saving bandwidth and CPU. The important detail is that your ETag must change when the representation changes; I usually derive it from an updated_at timestamp + id, or a real content hash if needed. I also set Cache-Control appropriately so intermediaries behave. This is a simple, standards-based performance win that works without introducing complex caching infrastructure.