4 ms·
Lately I've been a fan of lazy preloading. First I just load the requested page and all resources on it. Then, if javascript is enabled, I start loading the res
by c22 5y ago
Lately I've been a fan of lazy preloading. First I just load the requested page and all resources on it. Then, if javascript is enabled, I start loading the rest of the site (or section of the site) into hidden dom elements, starting with the resources most likely to be requested next. Then the rest of the user's interactions on the site are near-instant and you can even bring the entire thing offline.
- zamadatix 5y agoThere was a "priority hints" feature that got put on hold in Chrome that let you set importance= of a resource to low/high which had this kind of use case in mind.
- teachingassist 5y agoIt amazes me that modern web frameworks don't already do this by default.
- frosted-flakes 5y agoThey do. Gatsby is one of them, which is why people freak out when they see that one request triggers 5mb of downloads. I think by default it only pre-loads links visible in the viewport when the page loads.
- edflsafoiewq 5y agoIt's wasted bandwidth if the user never clicks through to the rest of the site, which is really common (think an article linked on HN). The model a lot of devs have of the user's connection is a huge, unmetered pipe, possibly with short periods of intermittency (being on a train, etc). The web can be not such a great place if you don't match that model.
- teachingassist 5y agoI think I was expressing surprise that there isn't a mature infrastructure for this. (Thank you for introducing me to Gatsby) You could turn it off if and when you face any bandwidth limitations - if it was a mature system, then you could turn it off globally in the browser. Intermittency can be overcome with the right technical approach. It's potentially great for intermittent connections, since it can pre-download materials whenever your connection is good. I guess it won't be supported between different sites, because it introduces risky conflict between tracking and privacy, that hasn't been legally resolved. (Any external link creates a privacy/tracking/security/authentication hole, whether the user clicks it or not). Maybe that's what has ultimately prevented wider adoption.