Open bart-d opened 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?)
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:
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.
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?
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)
Yeah, I am always torn on infinite scrolling. Could also potentially infinite scroll up to x number of records.
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.