Country | CO2 |
---|---|
China | 29% |
USA | 11% |
India | 7% |
Russia | 5% |
ICT | 4% |
The ICT sector accounts for approximately 4% of global CO2 emissions, with a strong upward trend. If this sector were a country, it would be among the top 5 CO2-emitting nations. This fact is often overlooked in public perception. I aim to raise awareness of this issue and help make the web more efficient.
Motivation
Sending data over the internet consumes energy, much more than I anticipated before delving into the topic. A megabyte of transmitted data can cost tons of CO2 when sent to enough visitors (see calculation). Additionally, high data loads can result in long wait times for content to be displayed on a webpage. In fact, measures to optimize web performance and web sustainability are almost congruent as the diagram below illustrates.
- Resource Hints
- Progressive Font Rendering
- Deferred Rendering/Scripting
- Hosting on Renewable Energy
- Accessibility
- Privacy
- Dark Mode
- Minimize Data Transfer
- File Compression
- Caching
- Image Optimization
- Lazyloading
- Adaptive Design
- Minimize CPU Usage
- Client Side (JS, CSS)
- Server Side (Scripting, DB)
- CDNs
We can save energy through more efficient websites, while also reducing the time visitors spend waiting for their content. Everyone wins: website owners, visitors and the planet! I don’t want to go as far as claiming we’re saving lifes, but that’s actually how it was communicated within Google’s teams, when they were trying to speed up their services:
The calculation goes like this: the average human life expectancy is seventy years. That’s about two billion seconds. If a product has 100 million users and unnecessarily wastes four seconds of a user’s time every day, that was more than a hundred people killed in a year.
While this calculation is ethically questionable, it illustrates the point well. We should not take the loading time of our web content lightly.
Prolonged waits for content cause visitors to lose sight of their original intention. Visitors are easily distracted, a phenomenon that is exacerbated by increasingly shorter attention spans.
Why then are not all websites optimized down to the last kilobyte? Well, only in recent years awareness of how the speed/performance of a website affects user behavior has been growing. Neither performance nor resource consumption were criteria in web product specifications and often it’s still lacking to date. Slow web content is often optimized only when the published content is too slow. The optimizations then improve the status quo but often fail to create a sustainable change in work processes. I want to help effect a change in mindset.
CO2 Calculation Example
We can use the open-source library CO2.js to estimate how much the data transfer alone from a server to its visitors costs.
Let’s look at the website of German news portal Der Spiegel. Since we’re only interested in the rough scale of carbon emission, I want to make a few simplifying assumptions.
- All visitors only access the homepage.
- 1% of all visitors access the page uncached (first visit after a long pause)
- All visitors accept the privacy conditions.
- All visitors scroll down to the first video section.
- No Ad-Blockers are used.
- Everyone gets the same ads as I did in my tests (nothing personalised, no changes over time).
I conducted tests using Chrome on my laptop with a mobile device emulation.
During the initial loading, accepting the privacy policies and scrolling of the website, there was a data transfer of 8.4 megabytes. However, during a subsequent visit just one day later, this was reduced to 4.2 megabytes, which is exactly half the payload.
Fortunately, hosting of the website is green, resulting in some CO2 savings.
However, the transfer of data per page view costs 447mg CO2. Now, let’s calculate with 166 million visits per month. This leads to 890 tons of emitted CO2 per year and corresponds to the stored CO2 of 40.000 mature trees. 🤯
While the numbers may seem staggering, the good news is that there are achievable solutions that could significantly reduce these emissions, even on a conglomerated website like spiegel.de
Simple Optimization Works
Especially for high-traffic websites, small changes can have a huge impact. In the example calculation above, saving 2MB of data for new visitors and 1MB for returning visitors would mean a saving of 213 tons of CO2 per year. That’s more than 27 times as much as an average European person consumes or as much as 10,000 mature trees can store in a year. And the good news is, it wouldn’t be difficult to achieve such savings. Thus, making a real difference by just making sure best practices are followed.
Optimization | Context | Difficulty | Savings |
---|---|---|---|
Use of modern image formats
A lot of third party images are in older formats such as jpeg or png. Some images are not optimized for web at all. Using webp or the newer avif could result in lots of savings. | 95%+ of all visitors | Medium | 3MB+ |
Enhance text compression
At least one huge file does not have text compression enabled at all. Most files are compressed with gzip, brotli could be a more efficient alternative for most of these assets. | All visitors | Easy | 500kB+ |
Improve Caching
Cache lifetime seems too short for some assets that will likely never change. If they happen to change frequently, a hashed file name could be used. | Returning visitors | Easy | 200kB+ |
Enable Back/Forward Cache
Some features prevent the back/forward cache from working. A fix would prevent a lot of data transfer upon navigation via the back button. | Visitors with journeys on the website | Medium | 5MB+ |
Disable video autoload
It goes without saying that autoloading videos transfer a lot of data. This feature seems to be enabled even for visitors with slow mobile connection (3G).
| Visitors after scrolling | Easy | 3MB+ |
How We Can Effect a Change in Mindset
The problem is not a lack of willingness to save CO2. Rather, it’s a lack of awareness regarding the CO2 emissions of websites. So, better communication is needed. I’m pleased to see that the W3C has established a working group on sustainability, which defined guidelines on the topic in the fall of 2023. I hope that such an authoritative institution in the web will generate the necessary attention. The concept of sustainability here is much broader than just ecological and aligns with the definition of the Sustainable Web Manifesto, which I have signed. Sustainable web development is thus:
- Clean (based on renewable energies)
- Efficient (uses as little energy as possible)
- Open (accessible and privacy-protecting)
- Honest (no misleading content)
- Regenerative (supports sustainable economies)
- Resilient (robust and secure)
Since many website operators primarily care about their own profitability despite the reasons mentioned, it is a blessing that performance and sustainability are closely intertwined. It is easier to convince when there is a correlation between web optimization and the success of the website.
- When referring to CO2 here, I mean CO2 Equivalent (CO2e): a metric quantifying the impact of various greenhouse gases on global warming relative to carbon dioxide over a specific period.
- The estimate is based on data from a review for the year 2020 and compared with a report from the European Commission.
- This library provides several models on which the carbon emission is measured. In the calculation below, we’ll use the Sustainable Web Design model. If the server’s operator discloses its energy sources, this data is used; if not, the average CO2 intensity of the respective countries is used. There are discussions about whether data transfer is the best proxy to estimate carbon emission, but for the moment, it’s the best we have.
-
Calculation using the CO2.js (v0.16) library method
perVisitTrace(1000*1000*8.4, true, {dataReloadRatio: 0.5, firstVisitPercentage: 0.01, returnVisitPercentage: 0.99, gridIntensity: { dataCenter: { country: "DEU" }, device: { country: "DEU" }, network: { country: "DEU" }}});
- Calculating with 22kg of absorbed CO2 per year.
-
Calculation using the CO2.js (v0.16) library method
perVisitTrace(1000*1000*6.4, true, {dataReloadRatio: 0.5, firstVisitPercentage: 0.01, returnVisitPercentage: 0.99, gridIntensity: { dataCenter: { dataCenter: { country: "DEU" }, device: { country: "DEU" }, network: { country: "DEU" }}});
. The resulting 1,101mg are again multiplied by 166,000,000 x 12, which leads to 677 tons of emitted CO2. - The correlation has been demonstrated through numerous case studies.
- Levy, S. (2011). In the Plex - How Google Thinks, Works, and Shapes Our Lives. 1st Simon & Schuster hardcover ed. https://openlibrary.org/books/OL26318641M/In_the_Plex (last opened: 25.11.2024)
- https://www.nngroup.com/articles/response-times-3-important-limits/ (last opened: 25.11.2024)
- https://www.fastcompany.com/90994638/attention-span-shrinking-social-media-tiktok-long-videos (last opened: 25.11.2024)
- https://www.thegreenwebfoundation.org/green-web-check/?url=https%3A%2F%2Fwww.spiegel.de (last opened: 25.11.2024)
- Statista: https://web.archive.org/web/20240210130704/https://de.statista.com/statistik/daten/studie/154154/umfrage/anzahl-der-visits-von-nachrichtenportalen/ (last opened: 25.11.2024)
- Umweltbundesamt: https://www.umweltbundesamt.de/daten/klima/treibhausgas-emissionen-in-der-europaeischen-union#pro-kopf-emissionen (last opened: 25.11.2024)
- https://w3c.github.io/sustyweb/ (last opened: 25.11.2024)
- https://www.sustainablewebmanifesto.com/ (last opened: 25.11.2024)
- C. Freitag, et. al. The real climate and transformative impact of ICT: A critique of estimates, trends, and regulations. Volume 2, Issue 9, 2021,100340, ISSN 2666-3899, https://doi.org/10.1016/j.patter.2021.100340 (last opened: 25.11.2024)
- European Commission: https://edgar.jrc.ec.europa.eu/report_2023 (last opened: 25.11.2024)
- https://developers.thegreenwebfoundation.org/co2js/models/ (last opened: 25.11.2024)
- https://fershad.com/writing/is-data-the-best-proxy-for-website-carbon-emissions/ (last opened: 25.11.2024)
- https://developers.thegreenwebfoundation.org/co2js/methods/#pervisittrace-sustainable-web-design-only (last opened: 25.11.2024)
- https://www.eea.europa.eu/articles/forests-health-and-climate-change (last opened: 25.11.2024)
- https://wpostats.com/ (last opened: 25.11.2024)