News for hackers. Stuff that matters.
Re:Ask HN: Has HN been slow/spotty loading for you? by smackfu on Wednesday November 17, 2010 @01:43PM (#1915210)
Wouldn't server side caching run into issues since the page is different for each user? For instance, all the vote up/down buttons seem to have your username hardcoded into them as the href.
Re:Ask HN: Has HN been slow/spotty loading for you? by andreas_bak on Wednesday November 17, 2010 @02:13PM (#1915327)
Yes you are right. I did not notice it. HTTP cache is effective on resources that are same for all users.

One possible solution is to decouple the personalized data and load it separately using AJAX. Votes are already implemented in a similar way.

Generally, I am proponent of HTTP caching. It requires some modifications of web sites in order to be effective but still the whole system remains less complicated, compared to implementations of cache on back-end (like `memcached').

For example reddit, which is similar to HN, is in constant struggle with their cache subsystems (http://blog.reddit.com/2010/05/reddits-may-2010-state-of-ser...). I believe it can be avoided by keeping cache and web site code apart.

Re:Ask HN: Has HN been slow/spotty loading for you? by smackfu on Wednesday November 17, 2010 @02:17PM (#1915344)
I know rails has the concept of caching HTML snippets, so you still have the page construction cost, but you avoid the database calls.
Re:Ask HN: Has HN been slow/spotty loading for you? by preek on Wednesday November 17, 2010 @02:05PM (#1915300)
Yes, it would.

I don't know how many people are not logged in, though. Those pages could be cached for a minute or so.