[wp-hackers] Caching in core? (was: Caching in 2.5: anyone has a file-based caching plugin?)

Mahmoud Al-Qudsi computerguru at neosmart.net
Sun Mar 23 16:59:57 GMT 2008


> I was thinking to cache not just full-html pages, but also serialized
> objects. For some blogs (say, one with some php ad rotating system),
> it would make sense to disable full page caching entirely. Caching
> these objects will require extending the current WP_Cache to allow
> invalidation of groups of objects (i.e., all posts, all comments,
> etc). This is quite a large, large project, actually. Maybe it isn't
> even possible to implement something like this without major breakage;
> perhaps pages have to be specifically marked as 'fullpage cachable'
> and 'object cachable'; unmarked pages would go straight to db.

That's what the current object cache does, though.. It *was* a big project, and WP 2.5 references the cache even more than previous versions do.

Definitely we should look to hook into the object-cache in as many places as possible in the code; but for the most part, that's already being done. AND the hooks are in place to invalidate it.

For instance, I hacked "Brian's Latest Comments" module (~30+ queries per page to get all comments, associate comments with posts, etc.) to use object-cache *and* use WP hooks to invalidate the cache when a new comment is made, deleted, approved, or unapproved. WP already does that with some of the widgets, and throughout the core.

Maybe I'm missing something here, but most of what you're suggesting is already there :S

-MQ



More information about the wp-hackers mailing list