Closed kevinfarrugia closed 3 months ago
A few questions:
decodedBodySize
so we followed suit.wptRequest.response_headers
for cross-origin resources.Oh I missed that this was being added to images.js, I presumed it was for performance.js. Oops. OK seems fine in images.js (unless easy to add to responsive_images.js). Ideally we'd merge that and responsive-images.js I guess, but that seems like a bigger change we'd want to do with the Media chapter.
Fair point. It isn't clear on https://github.com/w3c/largest-contentful-paint/issues/86 whether it is calculated on encoded or decoded body size.
I would imagine it's decoded size.
Other tools (for example https://www.phpied.com/quick-bpp-image-entropy-check/) seem to use decodedBodySize so we followed suit.
But you didn't. You used encoded size?
Other tools (for example https://www.phpied.com/quick-bpp-image-entropy-check/) seem to use decodedBodySize so we followed suit.
But you didn't. You used encoded size?
Sorry I mixed them up. The other tools use encodedBodySize
but TBF I am not sure which is correct.
Closing in favor of using existent responsive_images.js
custom metric.
Add
bytesPerPixel
custom metric. This is calculated as (filesize in bits) / (image display height * image display width)Note that it would return
0
for cross-origin images that do not include thetiming-allow-origin
header.Test websites: