Question 


mADL for refreshing cached results


Answer 


mADL for refreshing cached results

Description #

Here is some sample mADL code for caching fetch results.

Examples # 

$intival_seconds = 15 * 60;

$lastFetchTime = $t->getJourneyObject('lastFetchTime');

if($lastFetchTime + $intival_seconds < time()){

// fetch + rows code here
// $t->fetch();
// $t->rows();

$t->setJourneyObject('lastFetchTime', time());
$t->setJourneyObject('data', $t->result);

}
else {
$t->result = $t->getJourneyObject('data');
}

If it doesn't work let me know. I'd suggest emailing or appending something if the condition is true - for testing, then removing it.