Let's use a web based image gallery as example:
You load the gallery and land on page 1, seeing the most recent images as thumbnails. You take some time to load a few images and comment on them in different tabs. Now you want to continue browsing the images where you stopped and go to page 2 on your first tab. Most of the images on page two are the images you just saw on page 1! Now you have to return to page 1 to see the newest images.

Naturally, it's because the images moved up because new images were posted in the meantime and imagines only remain on the same page for a short time.

Then why aren't we inverting page numbers?
Why not put the very oldest images on page 1 and the newest image on the current or a new page?

Images would always stay on the same page (unless images are deleted, unless images have fixed page numbers). Having not enough content for the newest page could be solved with a virtual first page that displays the first x images.

This pattern is applicable to most content on the internet and I can't remember any page with numbered pages that work the way I'd like it to. It would feel much more natural and logical to me.

  • What sort of image gallery involves such behaviour. I suspect you refer to a very specific one. – Izhaki Dec 18 '15 at 14:58
  • As Izhaki mentioned, this seems like a very specific image gallery. And it includes them not handling having new images. Not like a general problem with image galleries. – Daan Dec 18 '15 at 15:07
  • @Izhaki, I have seen this pattern many times, most commonly on posts and articles rather than images, but I assume it would be the same. If the page loads content via AJAX, this is the default behavior on most scripts. A good example is Facebook: let's say you are reading a post and see another post below it. Now, click on an image gallery or do any action that takes you out of the reading experience (even writing a post) and you'll find out loads of new posts you didn't see before, and many times the post you were seeing is very hard to find – Devin Dec 18 '15 at 18:01
  • "This pattern is applicable to most content on the internet" Really? I've never seen it. – David Richerby Dec 18 '15 at 22:07

The site wants to show a full page of the most recent items to the user, but the total number of items is not a multiple of the number of items per page. Thus in the "newest" view, it defines "page 1" at any given time as one page's worth of the newest items at that time, "page 2" as one page's worth of the newest items that are older than all items on page 1 at that time, etc. I have seen this behavior on at least Slashdot, SoylentNews, and Not Always Right.

The reason is easiest to explain in MySQL:

ORDER BY post_date DESC LIMIT 20 OFFSET 20*(:pagenum-1)

This page paradigm causes new items to push old items onto higher numbered pages, which makes it impossible to form a link to the page that contains a particular item. Perhaps a site might want this, in order to encourage users to rely on permanent links directly to a particular item (which causes a whole page of advertisement views for just one item), browsing from page to page (which causes additional advertisement views), or full-text search (which causes advertisement views on the results page).

But think about what would happen if a site didn't do this. The front page would not have a full set of items, and the user would get the wrong idea of how many items are available on the site. If there are a lot of posts, but the query to determine exactly how many there are is expensive operation, especially in search results, this may cause the poor experience of long page loads. And the newest page having the highest number might produce a feeling of archive panic in the user.

One way to ensure page number stability is to employ a strategy similar to ciphertext stealing. Put the oldest items on page 1, and if the last page is not full, pad it with duplicates of the second to last page. For example, with 3456 items and ten items per page, the first 3450 items would go into pages 1 through 345, and then items 3447 through 3450 would be repeated along with items 3451 through 3456 in the last page.

Another strategy involves not numbering pages at all. Instead, the "newer" button means "show the 10 oldest items newer than the newest item on this page", and the "older" button means "show the 10 newest items older than the oldest item on this page." Internally, the system would use the sequential item number or the post date as a key to determine which items to show. This "since" paradigm is robust even to item deletion, unlike numbering from oldest or from newest. MediaWiki uses it, for example.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.