Im creating a simple app, for internal use, with basic (facebook like) functionality, i have a wall, where users can create a ‘post’ and then other users can comment.
Here’s how i design it, When i create a post, its added to the ‘PostTbl’
and when a comment is made its added to the ‘CommentsTbl’
As i load all post, in the SQL statement i also do a Count() for number of comments for each post.
so now the web page loads with just the post, and with a link to view comments. when they click on ‘comments’ then i do a AJAX call to load comments for that post to the page.
But facebook so quickly loads POST and Last 2 Comments, immediately…
Anyone have an idea what do you think is their design pattern that they can easily do this so efficiently?
thanks all
Is it not the case that in Facebook when the number of comments are less than X (I can’t remember the number off the top of my head) then it will display them immediately when you click to see more. However when there are more than X comments it actually takes you to dedicated story page which has a listing of all the recent comments.
This suggests that in the former example, all of the comments are pre-fetched but just hidden from view.