-
Notifications
You must be signed in to change notification settings - Fork 128
Add Speculative Loading opt-in for authenticated requests #2097
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
base: trunk
Are you sure you want to change the base?
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #2097 +/- ##
==========================================
+ Coverage 67.18% 67.32% +0.13%
==========================================
Files 93 93
Lines 7750 7783 +33
==========================================
+ Hits 5207 5240 +33
Misses 2543 2543
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Speculative Loading was omitted from logged-in users per #1157:
See also #1157 (comment):
Nevertheless, if the server is able to handle the load of additional dynamic non-cacheable requests, there should be an opt-in to allow users to enable Speculative Loading for logged-in users. For sites where users are primarily logged-in (for example e-commerce, forums, social, membership) there should already be infrastructure in place to scale for non-cached responses. Users of such sites should be able to benefit from Speculative Loading as well. In fact, Speculative Loading is even more necessary for such sites since uncached requests involve more latency.
Being able to opt in to Speculative Loading would allow the administrators to experience the site more closely to what regular visitors experience, without first having to log out. In order to facilitate this specifically, the opt-in can limit to just administrators in addition to unauthenticated visitors. (Maybe the plugin should even default to enabling Speculative Loading for administrators, so they are able to see the impact of the plugin after it is activated.)
This is related to the No-cache BFCache plugin which allows for instant back/forward navigations to be enabled for authenticated pages. With this PR, authenticated pages also can leverage Speculative Loading. This greatly improves the experience of a logged-in user browsing around a site, perhaps the single user who browses the site the most: the administrator!
This adds a new option to the settings screen:
Adding an such an option to the plugin does not violate the 80% principle since it's not targeting core.
To Do