Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions sql/2025/page-weight/use-efficient-cache-lifetimes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- looks at the distribution of wasted bytes from resources identified by the Lighthouse "Use Efficient Cache Lifetimes" audit
-- https://developer.chrome.com/docs/performance/insights/cache
SELECT
percentile,
client,
is_root_page,
--get the wasted bytes from resources that could be cached longer, in KB
APPROX_QUANTILES((CAST(JSON_VALUE(lighthouse.audits['uses-long-cache-ttl'].numericValue) AS FLOAT64) / 1024), 1000)[OFFSET(percentile * 10)] AS wasted_kb
FROM
`httparchive.crawl.pages`,
UNNEST([10, 25, 50, 75, 90, 100]) AS percentile
WHERE
date = '2025-07-01'
GROUP BY
percentile,
client,
is_root_page
ORDER BY
client,
is_root_page,
percentile