Hi,
Cache is not woking in my app, I'm fetching some data from database then setting into f3 set after that whenever I tried to fetch that data it comes from database not from cache? what is the issue?
index.php
$f3->mset(array(
...
"CACHE" => true,
...
Controller:
public function index($f3) {
$currencySymbols = \Helper\Master::getAllCurrencySymbolsCultureWise($f3);
echo "<pre>";
print_r($currencySymbols);
exit;
\Helper\Master
/*
* Get All currency symbols cultures wise
* @Usage: \Helper\Master::getAllCurrencySymbolsCultureWise();
*/
public function getAllCurrencySymbolsCultureWise($f3){
//$f3 = \Base::instance();
if($f3->exists('currencySymbols')){
$rows = $f3->get('currencySymbols');
$rows[]='Return from f3 cache';
}else{
$sql = "SELECT culture.cultureid, currency.symbol
FROM s_culture culture
INNER JOIN s_currency currency ON culture.currencyid = currency.currencyid";
$rows = $f3->get('db.instance')
->exec($sql);
$rows[]='Return from fresh query';
$f3->set('currencySymbols', $rows);
}
return $rows;
}
It always print data 'Return from fresh query', there is an empty folder tmp/cache, but nothing being stored in cache folder, any idea what am I doing wrong?