Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lazy-loading (feature) #433

Closed
contaoacademy opened this issue Apr 10, 2019 · 8 comments

Comments

@contaoacademy
Copy link

commented Apr 10, 2019

Description
As described in this article by Addy Osmani, there will soon be native support for lazy-loading in Chrome 75.

Is it possible to implement this in Contao 4.8, too?

<img src="celebration.jpg" loading="lazy" alt="..." />
<iframe src="video-player.html" loading="lazy"></iframe>
@netzarbeiter

This comment has been minimized.

Copy link
Member

commented Apr 10, 2019

Not lazy-loading, but a performance boost.
#354

@leofeyer leofeyer added the feature label Apr 30, 2019

@ausi

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

The lazy-loading feature is not enabled by default in Chrome 75. So there is currently no browser supporting this, see https://caniuse.com/#feat=loading-lazy-attr

But I agree that this is an important feature and we should probably use it once one of the major browsers supports it.

Any ideas on how we should implement it?
Should it be a setting of the image size?
Or just a global or a theme setting?

@leofeyer

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

I'd vote for "setting of the image size".

@Toflar

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

This is the spec PR: whatwg/html#3752
I think we should wait until there‘s something official.

@obendev

This comment has been minimized.

Copy link

commented Aug 7, 2019

I definitely think we should implement this in Contao 4.9 LTS, since this feature will definitely come in the feature.
As ausi said before it isn't available by default, but since it is already shipped in Chrome, we can be 100% sure they are testing this feature by Chrome users.

I mean this is just a nice handy feature, no breaking change.

It would be really cool to see more of this new fancy features in Contao.

@xchs

This comment has been minimized.

Copy link
Contributor

commented Aug 7, 2019

Some more info on this: https://web.dev/native-lazy-loading

@obendev

This comment has been minimized.

Copy link

commented Aug 17, 2019

It's now live in Chrome 76 https://caniuse.com/#feat=loading-lazy-attr

@ausi

This comment has been minimized.

Copy link
Member

commented Sep 1, 2019

Pull request: #703

@leofeyer leofeyer closed this Sep 1, 2019

leofeyer added a commit that referenced this issue Sep 3, 2019
Add support for lazy loading images (see #703)
Description
-----------

See #433

I only added support for `loading="lazy"` for now because `eager` and `auto` don’t change the default browser behavior currently.

Commits
-------

fb41e3b Add support for lazy loading images
5926d05 Add lazyLoading property to model
7043272 Coding style
21bc687 Move lazy loading checkbox to own group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.