4 ms·
That's well done. Curious why you fetch the rss at page load versus doing it when a search is performed though.
by tyingq 9y ago
That's well done. Curious why you fetch the rss at page load versus doing it when a search is performed though.
- fiatjaf 9y agoYes, I want this answer.
- yodon 9y agoPulling the list on page load makes sure the code responds fast when the user starts a search
- tyingq 9y agoI guess, but it then needs to load every page referenced in the RSS so you're preloading only one file of a much larger count. And you're adding the weight of the RSS file for every visitor, even if they never do a search.
- swiley 9y agoThe user should be able to consent (or not) to expensive operations like that.
- marcuslager 9y agoIf they have js enabled they already did.
- tyingq 9y agoTrue, but there is some validity to the point. On a large site you might burn a lot of your mobile data allotment with one search. That's not intuitive or obvious. Might be nice to implement limits and a more button in the code so it doesn't scrape the whole site at once.
- jstanley 9y agoYou could defer it until they start typing in the input box. Still better than waiting until they click search, and doesn't waste bandwidth for the average case.
- z3t4 9y agoThe search text input is disabled until the RSS is fetched. So it's because of UI design. If there's an error, the search box will stay disabled. Users are more OK with something being disabled, then something appearing to work, but doesn't. It also makes the search slightly faster.