[wp-hackers] Caching as part of the core

Mike Schinkel mike at newclarity.net
Thu Jul 19 23:01:20 UTC 2012


At the risk of wading into the deep end... :)

I think "Should caching be in core or not?" is the wrong question.  As I think Andrew Gray implied, core should have APIs that enable different types of caching and maybe a "Core plugin" (please don't shoot me for that one :-) that offers a very basic level of caching for those who need it but are afraid to explore the wild west of the plugin repository (or is could just be a regular plugin in the repository.)

Otto explained it well, there are (at least) two types of caching, page and object, and he also explained how complex it can be.  And where there is complexity there is functionality that could benefit from a lot of eyes and a lot of hands.  There are caching patterns to be discovered and turned into an API if only there is will to include such an API in core. One team working on one website typically cannot afford the time to learn what they need to know to get caching right, even with available plugins; "it takes a village."

As an aside the sites our team works on don't use caching yet even though they really need them because of the complexity of the available caching plugins and the relative lack of technical articles surrounding those plugins. So we've stayed away to avoid the problems associated with caching plugins that don't have the support of core (i.e.  I'm pretty sure at least WP Total Cache makes on-the-fly modifications to core, for example.)

If we instead had core caching APIs, there would be hundreds of articles written about them, and at least one of them I expect would be be a very well written article from Otto.

As is, caching is a black art that only a handful of people have really worked on because in part core doesn't have a caching API. And AFAIK none of the plugins available have APIs that can be extended. Instead they are plugins that provide a smorgasbord of functionality which is great as long as you don't have any reason to get into the weeds to understand it yourself and what you need is on their menu. 

So in summary, I would love to see WordPress implement standard caching *APIs* in core that would enable more people to fine tune their caching and so 3rd party caching plugins could be easier to install and be made more reliable.

JMTCW anyway.

-Mike 

P.S. 

On Jul 19, 2012, at 12:57 PM, Otto wrote:
> Finally, here's the key point about caching: *most users don't need
> it*. If you're a person writing a blog that gets less than 1000 hits a
> day, caching ain't going to do much for you. Not really. Sure, your
> site might go from 5 seconds down to >1 second load times, but if
> you're not getting the traffic anyway, then cache isn't going to make
> your traffic increase in any real way. When you start getting some
> real traffic, 3000+ hits a day, that's when you need caching. That's
> when speed of load starts to really matter. The majority of
> WordPress's 70 million+ users aren't getting particularly serious
> traffic. Most websites don't, you know.


In this particular case you are dooming the 5 second page load to a self-fulfilling prophesy of no traffic; at 5 second page loads Google will rank the site lower and likely send them very little traffic. So this argument is just not valid.  

OTOH if a site is already fast because of not much content and few performance draining plugins, well that's a better argument.  WordPress 3.4 is actually really fast, kudos to the team for that.


More information about the wp-hackers mailing list