redis-cache
redis-cache copied to clipboard
Get Jake's approval

- https://twitter.com/markjaquith/status/1297690855017521153
- https://github.com/coenjacobs/mozart
-
No global variables. Ever.
We need to refactor our templates as they rely on the current instance
$roc. Would coincide with Static class first as we can switch a lot of methods to be static. Obviously we need to rely onglobal $wp_object_cache; -
Namespace everything.
Not sure I agree for constants as well as the plugin entry file. Don't know if he would agree to this exceptions. Cache functions can not be namespaced for obvious reasons. Namespacing the
WP_Object_Cacheclass requires #251 or similar. -
Static class first
We can and should switch all methods no requiring state to static ones. Especially
WP_Object_Cachemight profit from the increased performance not having to load the current instance on certain methods. -
Avoid the god object
We should definitely break the
Pluginclass into logical parts. Might need to break apartWP_Object_Cachetoo. -
Defer init to
plugins_loaded/ One hook init I was under the impression that I opened a PR for this a while ago but it apparently didn't make it into master. Would be quite easy to do using the following code (ignores the "don't create instances" part)
add_action( 'plugins_loaded', Rhubarb\RedisCache\Plugin::class, 'instance' );
- Mozart Did try to use Mozart in the past but couldn't figure it out completely. Documentation is lackluster imho. If we can get it configured it would be quite nice to have though.