cache dalam wordpress sudah include di dalam wp-include/cache.php
sample :
$data = "some of data";
$get_cached = wp_cache_get('twitter_slideshow');
if (false == $get_cached) {
$get_cached = $data;
wp_cache_set('twitter_slideshow', $get_cached, '', '120');
} // Do something with $result;
Get cache berdasarkan key (unique), jika belum ada maka lakukan set cache dengan menggunakan key tersebut (gunakan expire time)
notes :
By default, the object cache is non-persistent. This means that data stored in the cache resides in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads unless you install a persistent caching plugin.
persistent caching plugin : w3 total cache -> enable object caching di settings dan disable preview
referensi : http://codex.wordpress.org/Class_Reference/WP_Object_Cache#Examples