Just for those who don't use Cache_Lite:
in 'pure' ;-) CakePHP code similar funcionality looks like (without
need to customize AppModel):
class Revenue extends AppModel {
function getRevenue( $country, $region, $year ) {
$cache_name = "revenue-$country-$region-$year";
$cache_expires = '+15 hours';
$cache_data = cache($cache_name, null, $cache_expires);
if (empty($cache_data)) {
$revenue = array();
// do big query here ....
// populate $revenue with results optimized for reuse
cache($cache_name, serialize($revenue), $cache_expires);
} else {
$revenue = unserialize($cache_data);
}
return $revenue;
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---