minvws / nl-covid19-notification-app-website

Project website
https://coronamelder.nl
European Union Public License 1.2
173 stars 51 forks source link

Lazy-load decorative Stories images #443

Closed davidhund closed 4 years ago

davidhund commented 4 years ago

Many browsers today support native lazy-loading of off-screen images. See: https://web.dev/browser-level-image-lazy-loading/

Adding the loading=lazy attribute to (some) images is an easy way to progressively enhance our pages.

This PR adds the attribute to the (large), decorative, Stories images.

Where supported this saves 4 requests and ~400Kb on initial page-load[1]…

[1] Note: these savings are quite large, mainly, because of the huge ~353Kb PNG stories images. The size of these images are addressed in PR davidhund:fix/34-optimize-images

anneke commented 4 years ago

Thanks again David! :)

anneke commented 4 years ago

I've decided to merge this into a development branch so I can double check it while I work, I will do the same with the other branch!