I have an interesting (to me) pagination related problem. I'm working on both the back end (a JSON API) and the front end (angular) of a comments system. Currently, the comments are page from oldest to newest, 20 per page, defaulting to the first page (oldest), with the API pages matching the pages we show to users.
We are switching to a front end with the following features: we show by default the x newest comments, with a "load previous" button to show y additional comments at a time. Additionally, you can deep link to a particular comment, which will mean showing x comments including x by default, with load y previous/next comments.
This is a private API for now, but may eventually become public. I'm trying to figure out how much of the new pagination behavior to handle in the API vs how much of it to handle in the client.
so, things I could put on the API or handle in the client include: passing perPage to the API or slicing up the data client side to handle the x / y per page requirements of the new s