thegreenwebfoundation / co2.js

An npm module for accessing the green web API, and estimating the carbon emissions from using digital services
Other
389 stars 49 forks source link

Sustainable Web Design Score in CO2.js #219

Open benjaminrancourt opened 2 months ago

benjaminrancourt commented 2 months ago

If this isn't the most appropriate place to discuss this, forgive me. I preferred to do it here rather than attempt to have a discussion on a closed Merge Request.

In #207, the calculation of the score according to the Sustainable Web Design methodology was introduced in CO2.js, but I wonder about its implementation. In my understanding of the methodology, the score is based on the data transfer size, but the current implementation in CO2.js is, instead, based on the carbon emissions that have been calculated...

https://github.com/thegreenwebfoundation/co2.js/blob/8f9539973fad0555ee37d20a609922b412d1fb8b/src/helpers/index.js#L258-L298

What is the reasoning for making such a change?

Thanks in advance for the explanations! 🤗

fershad commented 1 week ago

@benjaminrancourt Yes, data transfer is a key input for the Sustainable Web Design Model formula, however it's not the sole basis for estimating carbon emissions using that model. There are other factors (green hosting, caching, etc) that can also be applied. As a result, basing the rating system off the result of the carbon estimate allows these factors to also be considered, rather than it just being a straight 1:1 relationship with data transfer.