Open DahmaniAdame opened 3 months ago
@benorfaz @DahmaniAdame The only solution to tackle it would be to clear the OCI data completely while changing the logo. Is this something we'd like to do?
If the LCP element is the logo, a change will result in penalizing the LCP score. It's even worst if the old logo file no longer exists and results on a 404
.
Logo changes don't happen often. Even if the outcome is to fully reset OCI, it will still be worth it for the customer as it will take a month before the old OCI data are renewed on their own. That would affect CruX data and PSI field results by extension.
@piotrbak why does it have to be clearing OCI data completely?
Can't we do a check and see what to clear?
Maybe do a count of affected rows
SELECT COUNT(*) FROM `wp_wpr_above_the_fold` WHERE `lcp` LIKE '%old-logo-filename.jpg%')
0 = do nothing.
Between 0 and 50 = clear only corresponding rows:
DELETE FROM `wp_wpr_above_the_fold` WHERE `lcp` LIKE '%old-logo-filename.jpg%')
Above 50, wipe out all rows.
With the 50
threshold being filtrable.
That shouldn't have a noticeable SQL overhead even on large _wpr_above_the_fold
tables.
@DahmaniAdame That sounds like a complex solution to be honest. Since the logo change won't happen often, does it make sense to increase the effort that much?
@piotrbak We can go with clearing all and iterate if needed in the future.
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug In some case, the LCP element might be the logo if it's too prominent.
If the logo is changed, and OCI has been already generated, WP Rocket will keep preloading the wrong LCP image.
To Reproduce Steps to reproduce the behavior:
Expected behavior Though it's not generally expected for the logo to be the LCP element, but it might happen. We need to track logo changes, at least on the Customizer, and clear rows on OCI where it's being used as the LCP element.
Screenshots N/A
Additional context N/A
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming