Skip to content

Could someone explain how lazyloading works in Flynt? #455

Answered by domtra
munts asked this question in Q&A
Discussion options

You must be logged in to vote

@munts in addition to what @timohubois wrote:
the reason, why images are loaded after page load and not on scroll into view is the following line of code:

window.lazySizesConfig.preloadAfterLoad = true

We use this approach because from a visitor point of view, it does make sense to load images as early as possible when the browser is in idle.

As this is not the approach that native lazy loading takes, we decided in some projects to get rid of this line and might get rid of it in future versions of flynt. For now, this is the default but you can easily change that yourself.

Hope this helps.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@munts
Comment options

Comment options

You must be logged in to vote
1 reply
@munts
Comment options

Answer selected by timohubois
Comment options

You must be logged in to vote
1 reply
@szepeviktor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants