HTTPArchive / legacy.httparchive.org

<<THIS REPOSITORY IS DEPRECATED>> The HTTP Archive provides information about website performance such as # of HTTP requests, use of gzip, and amount of JavaScript. This information is recorded over time revealing trends in how the Internet is performing. Built using Open Source software, the code and data are available to everyone allowing researchers large and small to work from a common base.
https://legacy.httparchive.org
Other
328 stars 84 forks source link

Added lazy-in-viewport custom metric #202

Closed kevinfarrugia closed 3 years ago

kevinfarrugia commented 3 years ago

Updated the Images custom metric to include two additional properties, loading - which retrieves the value of the loading attribute on the <img> element and in-viewport - which returns a boolean value indicating whether the image is visible in the viewport.

Will be used in 2021 Resource Hints chapter.

Source: https://docs.webpagetest.org/custom-metrics/examples/lazy-images-in-viewport/

Sample WPT https://webpagetest.org/custom_metrics.php?test=210602_BiDcM8_940d25ae2138a2d2dae32c111fb964cc&run=1&cached=0

[
  {
    "url": "https://placekitten.com/401/401",
    "width": 401,
    "height": 401,
    "naturalWidth": 401,
    "naturalHeight": 401,
    "loading": "lazy",
    "in-viewport": true
  },
  {
    "url": "https://placekitten.com/402/402",
    "width": 402,
    "height": 402,
    "naturalWidth": 402,
    "naturalHeight": 402,
    "loading": "lazy",
    "in-viewport": false
  }
]