The home page of this site weighs 60 KB. I know because it says so at the bottom of the screen, and the number is measured every time the site is built. The median page on the web, by the HTTP Archive’s count, is a little over 2 MB on a phone. That is about forty times heavier, for a page that usually does the same job. Some text, a few pictures, a way to get in touch.
I did not set out to build a small website. I set out to build one that works on the phone most people around me carry, on the data they can afford. It turned out to be the same job.
Every page has a cost nobody sees on the bill. The server spends a little energy sending it. The network spends a little more carrying it. Then the phone does most of the work: it downloads the page, reads it, runs its scripts and paints it, and keeps the radio awake the whole time.
For one visit, none of this is much. My home page comes to about 0.009 g of CO₂ per view by the Sustainable Web Design model. That is a small number and I would rather say so than dress it up. So the case for lean code is not that one visit hurts anyone. It is that the same choices repeat millions of times, and they decide who gets to use what you build.
Most of what a typical page ships is not content. It is code the visitor never asked for. A framework to put text on the screen that plain HTML could have done. A tracking script feeding a dashboard nobody opens. A font in six weights when the design uses two. The picture above is how most pages look to me. A big field of things sent, and a small corner actually used.
So I start from the other end. A page is plain HTML and CSS until something on it genuinely needs to move or respond, and only then does it get a script, with its size written down. Images are drawn as small SVG files or sent at the size the screen asks for. The fonts live with the site and carry only the letters the pages use. Every page prints its own weight at the bottom, which means a change that adds 200 KB has to explain itself in public.
None of it is clever. Most of it is saying no to defaults.
The better reason is not the carbon anyway. It is the person on a three-year-old Android with a slow processor and a prepaid bundle. A heavy page costs them time, battery and money. A light one just works. Before this site went live, every page was loaded on an emulated budget phone, with the processor slowed six times and the network cut to mobile speed. If a page is quick there, it is quick everywhere. It never works the other way round.
I try not to claim savings I have not measured. Rewriting a backend in a faster language sounds green, but at small scale the gain can be smaller than the difference between two hosting regions. Sending less to the phone almost always helps, because the phone is where most of the energy goes and where the person feels it.
Put a number on what you ship and watch it every time it changes. The visitor pays for every kilobyte. They just never see the bill.
Sources. HTTP Archive, Web Almanac 2024, Page Weight chapter. Sustainable Web Design model (version 4), via the Green Web Foundation’s CO2.js. Page weights on this site are measured at build time.