Closed spacedmonkey closed 1 year ago
I have a couple of questions:
@spacedmonkey Does wp_cache_flush_runtime
clear the cache for the current request. Or can php store stuff in memory that lives beyond the request?
If it's on a request basis this would effectively do nothing.
@wp-cli/maintainers Would wp cache flush runtime
make sense for the command? wp cache flush
already exits, so adding a flag is easy enough. But is this the way to go?
Would
wp cache flush runtime
make sense for the command?
It does not 🙃
Does
wp_cache_flush_runtime
clear the cache for the current request. Or can php store stuff in memory that lives beyond the request?
It clears it for the current PHP execution, so within a long running CLI process it could be used to flush the runtime cache of the current process without wiping the cache for everyone else.
Then I would consider this a wont-fix
It would only work during a different command and calling WP_CLI::launch with the right arguments.
At that point would just be easier to call wp_cache_flush_runtime()
@tillkruss @spacedmonkey do you agree? if so we can close this issue.
IMO this doesn't need a command, no 👍
@janw-me @tillkruss Thanks for working through this! And thank you @spacedmonkey for the original suggestion 😊
Created another issue for this https://github.com/wp-cli/wp-cli/issues/5769
Feature Request
In WordPress 6.0
wp_cache_flush_runtime
function. This function can be used to clear cache keys stored in php memory to free up that memory. Not all object cache support this. For that reason,wp_cache_supports( 'flush_runtime' )
should be called before using this function / command.A clear and concise description of what you are actually trying to do, and in what way the current version of WP-CLI is not up to the task.
Describe the solution you'd like
Add a new command, like this.
wp cache flush runtime
to would callwp_cache_flush_runtime
. This is functionality is not supported, then it should fail fast.