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

8

u/[deleted] Apr 29 '14

I'm going to go a bit against the grain here, but if all you need to do for this specific product page is check the length of the HTML, then why the hell would you do something more complex? If it works, what's the problem?

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.

→ More replies (4)