16colo-rs / 16c

16colo.rs ANSI/ASCII Archive
5 stars 1 forks source link

pagination for tags #56

Open bart-d opened 4 years ago

bart-d commented 4 years ago

some tags are used thousands of time like "hidden text" for example. these slow down the tag page when you try to look them up. we need to either limit the output or use pagination/infinite scroll for these searches with a lot of results.

lordscarlet commented 4 years ago

It seems like we should have this for search in general. I keep meaning to ask you, "Why is it limited to 100 results?" then I notice the dropdown to expand the results.. but if its more than 500, what do I do then? (or does it know and keeps expanding the dropdown?)

bart-d commented 4 years ago

I'm somewhat obsessed with speed and responsiveness, i will always test for performance when i add something and this also what happened with the search results, when i introduced the search i wanted to prevent ever loading results when someone would search for something very common like extension=ans for example :) i didn't think searches beyond 500 results would be useful because who would scroll this far i results, it's like Google page 3 that is never reached :)

for tags it's a different matter though, as there is not limit on the amount of tags. and i ran in a similar issues with the artists page because there are a few artists that did output an crazy amount of artworks that would make their page load too long (after a few seconds i lose patience.. and visitors lose interest) :) so on that page i added infinite scroll, the page loads fast, because it will only load more when you scroll down, you'll see the scrollbar jump when more content gets added, try an artist page like this to see it:

https://16colo.rs/artist/enzo

if you grab the scrollbar and go immediately to the bottom, you can see the actual loading of the content and this is the downside of this solution.

lordscarlet commented 4 years ago

Is the performance issue in the data that is returned, or in the query itself? Is tehre any reason you have to load everything and can't load each page from the database as someone pages?

bart-d commented 4 years ago

I try to keep my queries under 30ms, the performance doesn't tend to be limited by the server. It's usually the client that is slow to render or to fetch (many) resources (often images in this case). Clients being browsers on desktop but also on much slower mobile devices.

Pages could be an alternative, till now I tried to avoid those because scrolling is more comfortable on mobile devices (40% of all visitors)

lordscarlet commented 4 years ago

Yeah, I am always torn on infinite scrolling. Could also potentially infinite scroll up to x number of records.