📜 ⬆️ ⬇️

And how do you do the pagination on your sites

Often I meet sites where paginator is made as follows

Option number 1
specifies the interval from and to
example:
...? start = 1 & end = 10

Option number 2
just the starting position is indicated
...? start = 10
And the developer himself later in the requests adds exactly how many records to choose from this position
')
Option number 3
when the page number is simply indicated, but the developer himself then calculates from which position and how much to choose

Personally, I use the third option.

Regarding the first option, I think that it is generally evil.
Because if there is a lot of data and there is a lot of joins
it is easy to write yourself ...? start = 1 & end = 1000000
Well, I think that you yourself guess what can happen to the server.

Regarding the second option, in principle there is nothing wrong with it, but as for me it is simply not aesthetically pleasing.
I like to see more, 1, 2, 3, ... 11
Than 10, 123, 153, ...

And what do you think about this?

Source: https://habr.com/ru/post/56223/


All Articles