Comments (4)
Thanks for creating this ticket @piotrbak .
You can reproduce this issue with some simple steps:
- Create a clean WP site.
- Add WPML Plugin, register it, add few languages.
- Install WP Rocket, go to Settings > Wp Rocket > Cache > "Enable cache for logged-in wordpress users".
- In the following request, the problem already occurs.
- It can also occur when applying a translation, and many other cinrcumstances (whatever hook ends up calling
rocket_clean_domain
ininc/functions/files.php
).
The problem is because in this method, the cache is cleared for each $url, and $url is retrieved using the function get_rocket_i18n_uri
or get_rocket_i18n_home_url
, which retrieves one URL per language.
This seems fine because some hooks are fired per URL, this logic seems to be correct, but later, a hook after_rocket_clean_domain
is fired per URL, which is bound to clear_full_cache
hook.
This later one, will do the same query on every step, so we propose to extract this hook from the foreach ( $urls as $url ) {
(Se how we tweaked this function in this gist)
An update query like this on every row of the wpv_table, repeated n times (where n=number of languages) locks this table and saturates mysql in large sites causing a significant performance impact.
from wp-rocket.
Scope a solution ✅
We can add a new filter outside of the loop rocket_after_clean_domain
, and update the hook used in the preload subscriber (Could be also good to investigate other usages of the after_rocket_clean_domain
filter to see if they could be changed and reduce the number of calls to the hooked methods).
Estimate the effort ✅
Effort [S]
from wp-rocket.
Seems good to me
from wp-rocket.
Small discussion: https://wp-media.slack.com/archives/CUT7FLHF1/p1698656302149819
We need to create a new action not filter exactly here:
wp-rocket/inc/functions/files.php
Line 870 in 06381b8
from wp-rocket.
Related Issues (20)
- Add control over LCP/ATF elements to backend for support to update HOT 1
- Regression Fatal Error due to sanitization HOT 1
- Warmup fetch links - Mobile version missing from DB (ATF table) for Homepage URL on fresh installs HOT 1
- Identify content-related HTML markups so that they can be precisely identified back when re-building the same page
- picture and img-srcset have no src attribute in the database, making the front end optimization crash HOT 1
- [Optimize Critical Images] - Warning: preg_replace_callback(): Compilation failed: regular expression is too large at offset XXX when the URL is too long HOT 4
- Add Filter to Customize Pattern in DelayJS Script Injection
- Optimize Critical Images - Collect the viewport size when sending the beacon data
- Optimize Critical Images - Clear related posts critical images along partial purge
- Cloudflare is deprecating their feature "Auto Minify"
- Picture markup not preloading properly with LCP
- Support Termly and BackWPup - plugins section
- Is there any issue with license server and website? HOT 5
- WP-Rocket outage today - Makes the plugin unusable HOT 17
- Fatal Error: Argument #3 ($code) must be of type int, string given HOT 1
- Avoid requests to wp-rocket.me to negatively impact site performances during downtime HOT 9
- Skip invisible elements as LCP candidates
- Skip elements without a background as LCP candidates
- Bump WordPress compatible version up to 6.5.4 HOT 2
- As a support agent, I want to be able skip specific LCP elements by selectors for diagnosis and patch issues
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.