-
Notifications
You must be signed in to change notification settings - Fork 6
Add queries for bfcache #75
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
Conversation
|
Looks good to me overall. Looking at the UNNEST and COUNTs, I was wondering if any of those need a DISTINCT clause? |
adamsilverstein
left a comment
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.
Looks good!
@adamsilverstein Using a |
|
Not sure - I'll test and get back to you. |
The query looks fine, I was just double checking that you had considered possible row duplication with UNNEST! |
felixarntz
left a comment
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.
Thanks @westonruter. The queries mostly look good, though they can be simplified, see feedback below.
Co-authored-by: Felix Arntz <[email protected]>
Co-authored-by: Felix Arntz <[email protected]>
|
@felixarntz I've applied the changes and re-run the queries. |
felixarntz
left a comment
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.
Thanks @westonruter!
I was curious to find out how often bfcache is disabled on WordPress pages. It turns a third of pages have it disabled. In the following table of results from
bfcache-score-counts.sql, thescorecomes from thebf-cacheLighthouse audit, where for this audit it is binary, with1meaning bfcache is enabled and0meaning it was disabled for 1 or more reasons:(
1820553/(3695471+1820553) = 0.330048056 ≈ 33%)In addition to
score, the Lighthouse audit also includes adisplayValuethat summarizes the number of issues found. I also queried for that instead of thescoreand found a single failure is 3x more common than two failure reasons, and two failure reasons are 3x more common than three failure reasons. The following shows the top 10 mostdisplayValue:However, when there is 1 failure reason it isn't always the same reason.
To get specific, I wrote
bfcache-failure-reasons.sqlto extract the underlying failure reasons:The presence of an
unloadevent handler amounts to ~21% of all reasons for bfcache being disabled. This may be reduced by Core-55491. But the top reason for bfcache being disabled is the site sendingCache-Control: no-store. That seems like the easiest failure to look for in the ecosystem and to fix.Lastly, in
heartbeat-script-presence.sqlI check to see how common the Heartbeat script actually is:So only 0.25% of pages (
14,095/(5,615,279+14,095)) have the Heartbeat present. Therefore, fixing Core-55491 is not really going to make a dent.