Hello. I have the following code as my cache
$frontCache = new \Phalcon\Cache\Frontend\Data(array(
"lifetime" => 86400
));
$cache = new \Phalcon\Cache\Backend\File($frontCache, array(
"cacheDir" => ROOT_PATH . '/var/cache/'
));
$cacheKey = 'json/my_json.' . $key;
$json = $cache->get($cacheKey);
if (is_null($json)) {
$json = make_json($key);
$cache->save($cacheKey, $json);
}
It works perfectly and creates files inside the json dir /home/user/www/var/cache/json/json_1
for example but when i try the following code, it always return an empty array
(...)
var_dump($cache->queryKeys('json/my_json'));
So, as far as it seems, the $cache->get()
and $cache->save()
functions can work with subdirectories but the $cache->queryKeys()
function cannot. So, is this a bug or i am using the cache service incorrectly?