I still don't get what kind of buffer you are talking about. Let me rephrase what I mean:
Let's assume a discussion has 100 posts. Let's further assume, that a total of up to 41 posts will be rendered initialy, the requested post +/- 20 posts.
Now someone follows a link to the 30th post. That means, that the posts #10 to #50 are rendered in the browser window. Now you scroll down until you get beyond post #50. The posts beyond #50 are shown as placeholders. Once the first placeholder becomes visible, the next 20 posts are requested and rendered, that means posts #51 to #70.
ganuonglachanh's suggestion is to request and render #51 to #70 once post #45 (#30 + 15) becomes visible. My suggestion was to trigger the request once e.g. the 70% mark of the height of the rendered posts #30 to #50 enters the browser window / becomes visible. That can be post #45 or #40 or #50 depending on the length of the individual posts already shown.
The simpler solution should depend on the mechanism, how the request of new posts is triggered at the moment. If it's triggered by the #50 post, ganuonglachanh's suggestion will be easier to implement. If it's triggered by having scrolled past x% of the height of the rendered posts (excluding placeholders), my suggestion would be easier to implement.
If you always want to preload +/-20 posts from the one that is currently looked at, you would need to request #51 once you get to post # 31. And if you just request one post, you'd have to request #52 once you scroll to #32. I assume you want to request not only #51 but e.g. #51 - #70, that would be your buffer. You could keep these posts in memory only as JSON objects and show just #51, then #52 etc. or you could render them all immediately. I don't see a reason for the former choice.
I think however, it doesn't make sense to initially load posts #10 to #50 and then, after scrolling just one post, to request the next bunch. I wouldn't wait for #50 to be read, but I wouldn't request new posts already at #31 either.
sledov
Posts are loaded anyway. Let them just be loaded outside of visible area, when they are included into the buffer.
That's, what the whole discussion is about, that was @ganuonglachanh's idea and that was my intention too. And I don't think, we differ here a lot.