Add queries for bfcache - #75
Merged
Merged
Conversation
westonruter
marked this pull request as ready for review
October 6, 2023 01:29
Collaborator
|
Looks good to me overall. Looking at the UNNEST and COUNTs, I was wondering if any of those need a DISTINCT clause? |
Collaborator
Author
@adamsilverstein Using a |
Collaborator
|
Not sure - I'll test and get back to you. |
Collaborator
The query looks fine, I was just double checking that you had considered possible row duplication with UNNEST! |
felixarntz
reviewed
Oct 26, 2023
felixarntz
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @westonruter. The queries mostly look good, though they can be simplified, see feedback below.
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
Collaborator
Author
|
@felixarntz I've applied the changes and re-run the queries. |
felixarntz
approved these changes
Oct 26, 2023
felixarntz
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @westonruter!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.