<p>Feel free to edit the title if you know how to formulate the question better. (Tagging is a problem as well.) The problem may be too difficult in this general form, so let us consider a concrete example.</p>

<p>You get a screenful of stackoverflow questions by requesting <code>/questions ?sort=newest</code> page. Next page link leads to <code>/questions?page=2 &amp;sort=newest</code>. I suppose that at server side, the request is translated into an SQL query with LIMIT clause. Problem with this approach is, that if new question were added while user browses first page, his second page will start with some questions he already saw. (If he has 10 question per page, and 10 new questions happened to be added, he’ll get exactly the same content second time!)</p>

<p>Is there an elegant way to solve this common problem? I realize that it is not that big a problem, at least not for stackoverflow, but still.</p>

<p>The best idea I have (apart from storing request history per client) is to use <code>/questions?answer_id=NNN</code> format. Server returns a page that starts with the requested answer, and puts the id of the first answer on the next page into next page link. There must be a way to write SQL for that, right? </p>

<p>Is it how it usually done? Or there is a better way?</p>

[{'answer_id': 38686, 'author': 'Paul Tomblin', 'author_id': 3333, 'author_profile': 'https://Stackoverflow.com/users/3333', 'pm_score': 0, 'selected': False, 'text': '<p>Most web sites I\'ve seen don\'t solve this problem - they show you a page including some content you\'ve already seen.</p>\n\n<p>You might consider that a feature - when you click "next" and see some content you\'re seen before, it\'s a signal that you want to go back to the front again because there\'s some new content.</p>\n'}, {'answer_id': 38687, 'author': 'dmckee --- ex-moderator kitten', 'author_id': 2509, 'author_profile': 'https://Stackoverflow.com/users/2509', 'pm_score': 0, 'selected': False, 'text': "<p>Tag each question with its time entered into the database, carry the time the frontpage was last loaded as a cookie or part of the URL, and limit the search to items <code>n</code> through <code>n+displaynum</code> as you go forward.</p>\n\n<p>But I wouldn't bother. This behavior is uniform enough that most users expect it, and it serves as a flag for when new data is becoming available. You can even open a new tab/window that starts back at the top of the list to see what has come up.</p>\n"}, {'answer_id': 153722, 'author': 'AJ.', 'author_id': 7211, 'author_profile': 'https://Stackoverflow.com/users/7211', 'pm_score': 0, 'selected': False, 'text': '<p>I believe the SQL (for MySQL) would be: </p>\n\n<pre><code>SELECT * \nFROM   entries \nWHERE  entry_id &gt;= @last_viewed_entry_id \nORDER BY entry_id \nLIMIT 50\n</code></pre>\n'}, {'answer_id': 153943, 'author': 'Casper', 'author_id': 18729, 'author_profile': 'https://Stackoverflow.com/users/18729', 'pm_score': 2, 'selected': True, 'text': '<p>This can\'t be done an easy way. For instance, the "Unanswered" list here at stackoverflow is sorted by number of votes. So if you\'d save the last ID of the page you\'re viewing (in a cookie, request, session, whereever) and someone upvotes a post while you\'re browsing page 2, page 3 isn\'t complete since the recently upvoted post could have been moved to page 1 or 2.</p>\n\n<p>Only way to do it is to load the complete list in someones session. Please don\'t...</p>\n\n<p>As already mentioned, let\'s hope people are used to this by now.</p>\n'}]
['https://Stackoverflow.com/questions/38680', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2515/']