Hacker News new | past | comments | ask | show | jobs | submit login

Or can we just cheat a little since the tolerance is much higher?

Sure, we call this caching. Imagine you have a blog with comments. You can generate the page for each user when he wants it, and then it's a real view onto the data that you have available. Or, you can generate it once a second and just serve the stale version -- not much can happen in one second. Making that compromise is the difference between handling 10 requests a second and 10,000 requests a second. Almost always a good tradeoff.

(Doesn't NYTimes do this?)




I've noticed this on Reddit. When you submit a comment it's inserted into the page with a bit of JavaScript but when you refresh the page it's gone. Refresh the page again after a few seconds and it's there.


My point was that asking the question in the first place is good practice to avoid doing work you don't need to, rather than the actual specific examples I made up on the spot. But thanks for the example!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: