Skip to content
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

Eliminate the detection time window #1640

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Nov 10, 2024

This is the second PR to address #1496.

The detection time window fails to adequately account for page caching so it's gotta go.

When the detection time window is enforced, new URL metrics are only collected if the user happened to visit when there was a page cache MISS or if the user happened to visit a couple seconds from within the time that someone else visited the page and the cache HIT returns a page that is only a couple seconds old. This is problematic, for example, on a site which primarily gets mobile traffic. If mobile visitors always trigger their responses to be cached, then when a desktop visitor comes around the detection time window will have already passed and that URL will be starved of URL Metrics for desktop.

Additionally, on a site that uses a stale-while-revalidate strategy for page caching, it's possible that the cached page is always older than the detection time window, resulting in URL Metrics never being gathered.

Also, a plugin like W3 Total Cache has a "Cache Preload" feature in which it will proactively crawl the site to prime the page cache. Since these requests are not coming from an actual user, they will circumvent a user causing a cache MISS and thus getting a page served within the detection time window.

@westonruter westonruter added [Type] Bug An existing feature is broken [Plugin] Optimization Detective Issues for the Optimization Detective plugin labels Nov 10, 2024
@westonruter westonruter marked this pull request as ready for review November 10, 2024 02:40
Copy link

github-actions bot commented Nov 10, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Base automatically changed from fix/od-with-page-caching to trunk November 13, 2024 04:55
@westonruter westonruter merged commit f9e464b into trunk Nov 13, 2024
20 checks passed
@westonruter westonruter deleted the fix/od-with-page-caching-2 branch November 13, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Bug An existing feature is broken
Projects
Status: Done 😃
Development

Successfully merging this pull request may close these issues.

2 participants