Pagination: Server Side or Client Side?

前端 未结 9 2038
生来不讨喜
生来不讨喜 2020-11-29 18:39

What is it best to handle pagination? Server side or doing it dynamically using javascript?

I\'m working on a project which is heavy on the ajax and pulling in data

9条回答
  •  醉酒成梦
    2020-11-29 19:12

    If you have large pages and a large number of pages you are better of requesting pages in chunks from the server via AJAX. So let the server do the pagination, based of your request URL.

    You can also pre-fetch the next few pages the user will likely view to make the interface seem more responsive.

    If there are only few pages, grabbing it all up-front and paginating on the client may be a better choice.

提交回复
热议问题