Comments (2)
This is an interesting thought. I generally don't eager load. I don't really have a great reason not to, though I suppose seeing that moment when images pop in is something I've gotten used to so I haven't thought much about further optimizing for perceived faster loading. In some ways I kind of like that moment.
That said, am curious. If eager loading do you typically do some sort of sequencing? Like, on idle, begin loading images in the page sequentially?
from monolazy.
I really only do this in specific cases like a slideshow which is built around instantaneous switching among a number of images or something. (So I definitely would buy an argument that this is out-of-scope for a generic component.) I'm still experimenting with the best way to do this. Previously, on page (or component) load I've called something like this within an on-idle callback:
prefetch () {
this.images.map(image => {
image.buffer = html`<img src="${image.source}">`
})
}
As an optimization, prefetch can run only if NetworkInformation returns a connection that seems like 4g or desktop or something.
I agree about slight delay in images appearing, as long as they're in intrinsically sized containers. In fact even with the above I usually add a slight fade-in animation.
from monolazy.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monolazy.