Hi everybody.
As an eco-friendly web developer, I always wonder how we can improve our work for the benefit of the environment and its users. Until recently, for example, we had to use JavaScript to defer loading images (popularly known as “lazy loading”). Now we can use the “loading” attribute natively, without any script, and browsers know what to do; this is great progress.
Today, I would like to propose a new HTML attribute to go further in this direction.
Background
A lot of images on the web are purely decorative, we all know that. These images, in particular those from image banks, are often dispensable, but consume bandwidth and contribute little to the user experience in the end, when they do not harm it.
Solution
What if we gave to developers a way to specify when a resource is dispensable without “breaking” the site?
Depending on the user configuration of the browser (and why not, ultimately, the quality of the available network), these images may or may not be downloaded from the server. We would then obtain a drastic reduction in the environmental impact of our online browsing while accelerating it.
This job could be done with a “facultative”
OR “optional” attribute.
Of course, this idea could apply to different types of resources.
What do you think ? (Thanks for reading)