redis-cache icon indicating copy to clipboard operation
redis-cache copied to clipboard

Get Jake's approval

Open tillkruss opened this issue 5 years ago • 1 comments

EgJS9AoWoAID0_Y

  • https://twitter.com/markjaquith/status/1297690855017521153
  • https://github.com/coenjacobs/mozart

tillkruss avatar Aug 24 '20 22:08 tillkruss

  • 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 on global $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_Cache class requires #251 or similar.
  • Static class first We can and should switch all methods no requiring state to static ones. Especially WP_Object_Cache might profit from the increased performance not having to load the current instance on certain methods.
  • Avoid the god object We should definitely break the Plugin class into logical parts. Might need to break apart WP_Object_Cache too.
  • 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.

naxvog avatar Aug 25 '20 12:08 naxvog