[wp-hackers] Jeff Atwood on WP Overhead

Jeremy Clarke jer-wphackers at simianuprising.com
Thu Apr 24 14:10:32 GMT 2008


Jacob Santos is a genius.

Also, one thing I've done and felt worked well was just caching
arrays/objects in the options table using custom keys in my private
plugins, like if I had a long slow query of "get all users, make sure
they have posted recently, check if they have an avatar uploaded,
organize them into random sets of 5" I would then just save the
resulting array into a wp option and create another option that has a
unixtime expiry date after which the first option will be refreshed.
Replaces heavy strain on the db with extremely light strain and
doesn't have any filesystem overhead. It's how WP already works for
storing feeds fetched through magpie.

Are there problems with this system? Other than the obvious semantic
issue (they're not 'options'), is there a performance problem I'm not
picking up on? Why not just create a 'caches' table that mimicks the
options table and give everything a key, value and expiry? Obviously
you'd still want to use supercache for sites that are getting tons of
hits, but this system would work really well for everyone right out of
the box, without fiddling with folder permissions etc.

-- 
Jeremy Clarke | http://simianuprising.com
Code and Design | http://globalvoicesonline.org


More information about the wp-hackers mailing list