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

feat: add total byte weight audit #1759

Merged
merged 3 commits into from
Feb 25, 2017
Merged

feat: add total byte weight audit #1759

merged 3 commits into from
Feb 25, 2017

Conversation

patrickhulce
Copy link
Collaborator

fixes #584

I'm not the biggest fan of this implementation (primarily because it feels like a rather arbitrary cutoff and not as actionable as the other audits) but thought it was a good place to start to gather feedback and ideas.

image

const URL = require('../../lib/url-shim');

// ~95th percentile http://httparchive.org/interesting.php?a=All&l=Feb%201%202017&s=All#bytesTotal
const FAILURE_THRESHOLD_IN_BYTES = 5 * 1024 * 1024; // 5MB
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In practice this also seemed to pass on image heavy gallery sites assuming they made reasonable attempts to optimize the images, which gives me a little more confidence that it's not overly noisy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked at what it is, but should we use the mobile stat instead of the desktop one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't change the result very much.
5MB is ~94th on desktop ~96th on mobile and the roundedness of it is a nice bonus.

@ebidel
Copy link
Contributor

ebidel commented Feb 22, 2017

WDYT about making this a scored audit? We could create a curve based on the httparchive numbers.

@patrickhulce
Copy link
Collaborator Author

WDYT about making this a scored audit?

I'm game, but I am a little hesitant because graphic heavy sites have legitimate reasons that they're in the higher percentiles. Curving between say 90 and 95 doesn't seem that useful either. What about start dropping off around 75th percentile, median at 90th, hitting 0 at 99th?

@ebidel
Copy link
Contributor

ebidel commented Feb 22, 2017

have legitimate reasons that they're in the higher percentiles

Certainly. But isn't the goal of this audit to raise awareness to those byte-heavy sites; mention they could be doing better? I don't care who you are, a 5MB on page load is too much :) Crazy that that's the median!

You'll definitely want to tweak the curve to make a decent score obtainable.

@patrickhulce
Copy link
Collaborator Author

OK I added scoring and based the 100 target based on the maximum bytes on what one could conceivably download with 3G throttling and the 10s TTI goal. (1.5Mbps * 10s ~= 1830 KB)
see chart Also added a link to whatdoesmysitecost

1600 KB = 100
4000 KB = 50
5000 KB = 24

image

@patrickhulce
Copy link
Collaborator Author

PTAL :)

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@paulirish paulirish merged commit 4e140a9 into master Feb 25, 2017
@paulirish paulirish deleted the total_byte_weight branch February 25, 2017 02:01
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

Successfully merging this pull request may close these issues.

Audit: total byte weight
4 participants