-
Notifications
You must be signed in to change notification settings - Fork 314
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
Use wp_cache_flush_runtime()
when available
#2915
Conversation
See also #2916. |
If this could be treated with some urgency, we have been unable to upgrade beyond ElasticPress 3.6.6 Since 4.x with Object Cache Pro plugin exhibits run-away Memory Usage whilst indexing |
The problem with One thing we could do is to add a new action at the bottom of the @tillkruss is that a change you would like to make? Thanks in advance! |
That's not correct. Setting For your example, Redis data is not touched.
No, it's up to this plugin to manage the object cache. Redis/Memcached plugins only supply the API to communicate with the external object cache. |
Added in WordPress 6.0
@felipeelia: For more context, the Action Scheduler plugin had a similar issue: woocommerce/action-scheduler#790 And this is how they solved it using |
wp_cache_flush_runtime()
wp_cache_flush_runtime()
when available
Hey @tillkruss, Thanks for the quick reply. I didn't notice that Redis Object Cache would overwrite the You made me curious about what you meant with I still think it is a good idea to have an action there just to give people the chance to do any extra steps they want but we can take care of that in another PR. |
Sorry, I kept it brief due to being on my phone. I meant that object caching plugins shouldn't hook into 1000s of actions of other plugins, but rather that each individual plugin should manage its own cache data itself with calls like ElasticPress is a bit special (like Action Scheduler), since you're running long tasks.
That makes sense, I'll add an action to the PR. |
That all makes sense @tillkruss, thanks. If you are going to add the action, can you please add |
Added. Feel free to rename of course. |
Description of the Change
The
wp_cache_flush_runtime()
was added in WordPress 6.0 and is safer to call than trying to unset the$cache
property.Changelog Entry
Credits
Props @tillkruss
Checklist: