-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
WDYT about making this a scored audit? We could create a curve based on the httparchive numbers. |
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? |
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. |
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) 1600 KB = 100 |
PTAL :) |
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 |
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.