How wp_cache is supposed to work, and does it help with performance?

In WordPress v2.5+ the object cache is not persistent. It will save things in memory, but for persistent caching across page loads you will need a plugin see here:

http://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Caching

Alternatively, use transients, which are persistent. The identifier must be 45 or less characters long, but the data attached to that identifier can be longer. Keep in mind that storing very large amounts of data this way is not recommended.

Leave a Comment