Download the PHP package akhela/website-carbon-calculator without Composer
On this page you can find all versions of the php package akhela/website-carbon-calculator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download akhela/website-carbon-calculator
More information about akhela/website-carbon-calculator
Files in akhela/website-carbon-calculator
Package website-carbon-calculator
Short Description Estimate your web page carbon footprint
License MIT
Informations about the package website-carbon-calculator
Website Carbon Calculator
Estimate your web page carbon footprint
Installation
API
Estimate web page carbon footprint
View the Google documentation to generate a Google Pagespeed Api Key
Output
For better performance, detect hosting energy type and store it in a database to avoid repetitive call to The Green Web Foundation.
Detect hosting energy type
How does it work
Calculating the carbon emissions of website is somewhat of a challenge, but using five key pieces of data we can make a pretty good estimate:
- Data transfer over the wire
- Energy intensity of web data
- Energy source used by the data centre
- Carbon intensity of electricity
- Website traffic
Under the hood, it uses Google pagespeed api and The green web foundation api
Website Carbon Calculator
The internet consumes a lot of electricity. 416.2TWh per year to be precise. To give you some perspective, that’s more than the entire United Kingdom.
From data centres to transmission networks to the devices that we hold in our hands, it is all consuming electricity, and in turn producing carbon emissions.
This project is widely inspired by the Website Carbon Calculator algorithm 2.0 and The Green Web Foundation co2.js
Glossary
- isGreenHost : server uses sustainable energy
- networkRequests : https://web.dev/performance-scoring/
- performanceScore : https://web.dev/resource-summary/
- domSize : https://web.dev/dom-size/
- speedIndex : https://web.dev/speed-index/
- firstMeaningfulPaint : https://web.dev/first-meaningful-paint/
- interactive : https://web.dev/interactive/
- bootupTime : https://web.dev/bootup-time/
- serverResponseTime : https://web.dev/time-to-first-byte/
- mainthreadWork : https://web.dev/mainthread-work-breakdown/
- co2PerPageview : estimated grams of CO2 produced every time someone visits the web page
Tests
Run tests