performance-leaderboard icon indicating copy to clipboard operation
performance-leaderboard copied to clipboard

Add carbon estimate results

Open fershad opened this issue 3 years ago • 0 comments

This PR adds back carbon estimates which were removed in #16.

The implementation uses thegreenwebfoundation/co2.js, so there is no need to make external API calls. The calculations use the median page weight as the basis for calculating a carbon estimate for a page.

Inside CO2.js, we use the Sustainable Web Design (SWD) model however utilise the perByte method. This does not apply any of the assumptions caching & return visitor assumptions that are made in the original SWD model. As a result, the carbon estimate returned is higher than what you would see for the same page using a tool like Website Carbon Calculator (which was used previously).

More details on the SWD model, and the CO2.js perByte method can be found at the links below:

fershad avatar Sep 29 '22 14:09 fershad