DEADScript: The Role Of JavaScript In Web Sustainability – Henri Helvetica, JSNation 2023

Discover how JavaScript impacts web sustainability and carbon emissions. Learn about the correlation between JavaScript requests and carbon footprint, the problem of unused JavaScript, and tools for estimating a website's carbon footprint.

Key takeaways
  • JavaScript contributes significantly to web sustainability, and its impact on carbon emissions is a growing concern.
  • The amount of JavaScript sent down the wire correlates closely with carbon emissions.
  • At the 75th percentile, 37 requests just for JavaScript are being sent down the wire.
  • At the 90th percentile, 62% more JavaScript requests are observed.
  • Unused JavaScript is a significant problem, with 40% of JavaScript being unused at the 75th percentile.
  • At the 90th percentile, over a megabyte of JavaScript is being sent down the wire, with 44% of it being unused.
  • The carbon footprint of a four-megabyte page is estimated to be 1.38 grams of CO2 at the 75th percentile.
  • The European Union is mandating sustainability reporting for large companies, including sustainability metrics or carbon footprint estimates.
  • The GreenWeb Foundation provides a tool called CO2.js to estimate the carbon footprint of a website.
  • Catchpoint’s Carbon Control feature provides an estimate of a website’s carbon footprint based on page weight and JavaScript usage.