I'm trying to follow the steps to cache plugin content at:
http://dougal.gunters.org/blog/2006/07/21/using-the-wordpress-object-cache
It looks like a fairly simple process. However I can not get the cache to work on the plugin level. For example I create a new plug in as follows, outputting "I've been cached at " and the current second, each time I generate the page it has a new second, rather than the pervious second.
<?php
/*
Plugin Name: ilm_test
Plugin Script: ilm_test.php
*/
function ilm_test_showhtml($param1 = 0, $param2 = "test") {
$mydata = wp_cache_get('mysettings', 'mycache');
if (false === $mydata) {
$mydata = "I've been cached at " . date('s');
$myexpire = 60 * 60 * 24; // Cache data for one day (86400 seconds)
wp_cache_set('mysettings', $mydata, 'mycache', $myexpire);
}
echo $mydata;
return $ilm_test_html;
}
?>
Any suggestions on how to make this work well using the swp-super-cache plugin?
My goal is to re-write the recent posts and most popular categories to be cached, in addition to the standard page caching. The 62+ quires per page load kills my page load time.