Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS performance API assumption #252

Open
hanstf opened this issue Feb 16, 2025 · 1 comment
Open

JS performance API assumption #252

hanstf opened this issue Feb 16, 2025 · 1 comment

Comments

@hanstf
Copy link

hanstf commented Feb 16, 2025

I am not sure where to ask this but can correct me if I put this discussion in the wrong place.

We are quite new in this field and currently trying to build a telemetry on our websites using the js performance API that will send all of the size of transfers of the APIs, resources and the page load to backend of all the visitors.

In the backend, we will be calculating the total sizes and produce the report at the end. We are planning to use the perByteTrace method, do you have any recommendation on what's the device assumption we need to adjust (we saw this https://www.thegreenwebfoundation.org/news/co2-js-case-study-step-ci/)? Since the performance API has taken consideration of the cache, the perByteTrace will not add assumption on the cache right?

Thank you so much!

@fershad
Copy link
Contributor

fershad commented Mar 3, 2025

Hi @hanstf , sorry it's taken a while to reply to this.

What's important to understand is that CO2.js in and of itself is just a wrapper that makes carbon estimation models easier to access for developers. So CO2.js doesn't have its own opinions.

The default model in CO2.js is the Sustainable Web Design Model version 3 (though version 4 is also available). So you'd need to look at those models to understand what assumptions or defaults they are setting.

To answer your question around caching, the perByteTrace function does not include repeat visits - so it does not include caching or repeat visitor percentage into the calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants