On development environments it's sometimes necessary to disable a persistent object cache. I could simply use the «Ephemeral» driver but this still enables WordPress wp_use_external_object_cache() which in turn saves the transients to the object cache instead of database. But that means transients are lost after each PHP process and this makes WP admin notably slow.
My suggestion is to introduce an environment variable WP_STASH_BYPASS that would cause an early return in object-cache.php. As WordPress double checks the existence of wp_cache_init() in wp_start_object_cache()https://github.com/WordPress/WordPress/blob/master/wp-includes/load.php#L622-L626 this would cause WP to do not assume an external object cache.
On development environments it's sometimes necessary to disable a persistent object cache. I could simply use the «Ephemeral» driver but this still enables WordPress
wp_use_external_object_cache()
which in turn saves the transients to the object cache instead of database. But that means transients are lost after each PHP process and this makes WP admin notably slow.My suggestion is to introduce an environment variable
WP_STASH_BYPASS
that would cause an early return inobject-cache.php
. As WordPress double checks the existence ofwp_cache_init()
inwp_start_object_cache()
https://github.com/WordPress/WordPress/blob/master/wp-includes/load.php#L622-L626 this would cause WP to do not assume an external object cache.