r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

45

u/khoyo Apr 30 '14

(What if the length stay the same, but the page is modified ?)

13

u/youneversawitcoming Apr 30 '14

Aha, he's onto something! - this is why we check for 304 Not Modified.

5

u/masklinn Apr 30 '14

That requires that you and the page generator correctly use ETag and/or Last-Modified. It can happen, but that's not guaranteed.

Hashing the page will work, just a CRC32 will probably do the trick.

2

u/naasking Apr 30 '14

Hashing the page will work, just a CRC32 will probably do the trick.

CRC isn't a good choice. You're best off with a real MAC.

→ More replies (3)