开发者

How does Stack Exchange generate load new pages so fast?

Look at the profile pages of users that have asked more than 10 questions. (e.g., https://webapps.stackexchange.com/users/2496/tobeannounced)

Now try skipping to questions 10-20, or page 2 of the questions they hav开发者_StackOverflow社区e asked.

The load for the new page is almost instantaneous.

How is this accomplished?

Simply be loading all the questions when the first page is loaded so that any additional pages that are called up load very fast? In other words, the additional pages are pre-loaded?


Using the network tab of Firebug for Firefox, you can see all HTTP requests being made. With this turned on you can see that clicking the next link fires off an HTTP request which grabs the next page of questions (i.e. it is not preloading all the questions with the initial page load). It's a small request, small response, and the server replies really quickly, which is why it happens almost instantaneously.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜