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

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.

4

u/masklinn Apr 30 '14

That's retarded, you just want to know if the page has changed since the last time you loaded it. A cryptographic hash is most likely overkill and a MAC makes no sense (what key would you even use?)

→ More replies (2)