[wp-hackers] Caching as part of the core

Mike Schinkel mike at newclarity.net
Tue Jul 24 17:57:12 UTC 2012


On Jul 24, 2012, at 7:32 AM, Otto wrote:
> On Tue, Jul 24, 2012 at 1:59 AM, Mike Schinkel <mike at newclarity.net> wrote:
>> 
>> The Transients API[1] would potentially be something that persistent storage could be based on using hooks.
>> 
>> But alas, it is loaded *after* advanced-cache.php and it depends on the hooks system, which is loaded even later.  Yet another example of how caching is hard to implement in WordPress because core has never needed to address these issues.
> 
> The transients API *uses* the object cache if it's set to be external.
> Any plugin could behave in the same manner.
> 
> I guess I'm not getting at what you even want here. The Object Cache
> API is solid and works well. Transients exist for persistent timed
> storage, and leverage plugins that implement persistent object
> caching. There's great plugins out there to implement persistent
> object caching, and any of them can be easily used for various
> purposes.
> 
> What more is needed? You speak about adding a caching API of some
> sort, but you completely fail to address what actually is in this
> magical API that would be useful or even valuable.

Please reread my comments, Transients are not available in the advanced-cache.php dropin.

See for yourself, define WP_CACHE as true in /wp-config.php and then create an /wp-config.php/advanced-cache.php with these two lines in it:

<?php
$data = get_transient( 'front-page' );

> I guess I'm not getting at what you even want here. 

One thing I'm asking for, said even more explicitly, is to require() /wp-includes/option.php (or a subset that includes the Transient's API and whatever it depends on such as hooks and the object cache) to above line 67 in /wp-settings.php so that it can be used in advanced-cache.php.  The other things I'll mention in a reply to Ryan Hellyer.

-Mike


More information about the wp-hackers mailing list