Update: Lazy loading shipped in Chrome recently
I just merged this PR, which adds
loading="lazy" to a bunch of images around dev.to.
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Documentation Update
This will get get us ready to benefit from the
loading="lazy" feature when it ships in Chrome. Shouldn't cause any problems to have it live now. This will mean on pages like lists the user won't get images loaded that are way below the fold.
I figure getting this in early will only help our SEO as I'd guess Google will be looking to reward this attribute when it ships.
You can turn it on now with
TODO: Implement on more images and iframes.
This functionality is expected to ship with Chrome 75 in early June, but this flag will let you play with it right now.
Will this have a major affect on anything in your life? No. You probably won't notice anything. But some images will defer loading until you are close to needing them—which is nice.
This was an easy change and we'll now be guaranteed to have the functionality ready the first day it ships generally.