Comments (6)
@MathieuLamiot @vmanthos Updated the AC
from wp-rocket.
@vmanthos, @Mai-Saad, @piotrbak: following Tabrisrp's investigation, he pointed out 2 issues. Would it be interesting to rework the acceptance criteria here? I might not understand everything, but it seems the AC cover the activation part (checking we send the right requests on activation), but not the RUCSS side-effect.
A few e2e scenarios might be needed to cover Tabrisrp's proposal?
from wp-rocket.
Acceptance Criteria:
1. When separate cache for mobiles is enabled when activating the plugin:
- We should send two requests, to desktop and mobile with defined pause between them:
- The user agent for both requests will be the same as in the preload:
2. When separate cache for mobiles is enabled when clearing the Used CSS:
- We should send two requests, to desktop and mobile with defined pause between them:
- The requests should be sent after clearing the cache, so the just preloaded cache is present
- The user agent for both requests will be the same as in the preload:
3. When separate cache for mobiles is disabled when activating the plugin:
- We should send only desktop request
4. When separate cache for mobiles is disabled when clearing the Used CSS:
- We should send only desktop request after clearing the cache
from wp-rocket.
@vmanthos When clearing the used CSS, did you do it from the admin side or from the front side via the admin bar?
The homepage preload is hooked on the used CSS clear, but only on the admin side.
from wp-rocket.
@Tabrisrp I cleared it using the admin bar menu item while in WP Rocket's dashboard.
I believe the same would happen if the theme is switched or the permalinks are changed.
from wp-rocket.
Reproduce the issue ✅
Reproduced
Identify the root cause ✅
There is 2 different parts in this issue, the activation one and the RUCSS clean one.
For the activation, we do a request to the homepage when activating, but we do not do the request for mobile.
For the RUCSS clean one, I noticed that we do have a method hooked on the related action, but right after in the truncate_used_css_handler()
method, there is a call to rocket_clean_domain()
, so the preload happens and is deleted right away.
There is only a cache file for the desktop version because there is a manual call to the homepage in the method after.
Scope a solution ✅
in WP_Rocket\Engine\Activation\Activation.php
- remove the call to the homepage
- add a new action
rocket_after_activation
in WP_Rocket\Engine\Preload\Activation.php
- Add the PreloadUrl controller as a dependency to the class
- In the activate method, add a new add_action on
rocket_after_activation
, to preload the homepage - add a method
preload_homepage()
, which will call$this->preload_url->preload_url( home_url() );
in WP_Rocket\Engine\Optimization\RUCSS\Admin\Subscriber
- Remove no longer necessary preload calls to the homepage in
truncate_used_css_handler()
, andtruncate_used_css()
- in
truncate_used_css_handler()
, switch the calls to$this->delete_used_css_rows();
androcket_clean_domain();
to make sure the clean happens before the preload.
Estimate the effort ✅
Effort [S]
from wp-rocket.
Related Issues (20)
- Make sure that the used CSS is generated withing 90 seconds from enabling the RUCSS option
- Possible conflict with Page Optimize HOT 3
- Add PHP 8.3 in our testing matrix
- Update DelayJS to 1.2.4
- It's not possible to exclude the YouTube thumbnail from LazyLoad HOT 4
- import settings isnot working with themify builder plugin
- Incorrect parameter passed to the increment_retries
- Conflict with ABEConnector plugin, regression of private posts changes HOT 3
- LCP & ATF: refactor global clearing, banners for SaaS features
- Used CSS won't be added to a page if there is a space in the closing title tag
- LCP/ATF relative image isnot excluded from LL
- Guard 'rocket_above_the_fold_optimization' filter from wrong values to avoid fatal error
- LCP preload won't be added to a page if there is a space in the closing title tag
- Pre-existing fetchpriority won't be detected if there are spaces around the equal sign
- Is there a way to use Cloudflare "User API Tokens" instead of "Global API Tokens"?
- Deprecate old hooks for RUCSS HOT 13
- The fetchpriority attribute isn't set for the LCP image HOT 3
- ContactForm7 not working since 3.15.6 HOT 6
- The value of the pre-existing fetchpriority attirbute is ignored when preloading the LCP HOT 2
- The fetchpriority attribute will be added to the LCP image in a comment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-rocket.