我正在尝试使用 Zend Cache 实现缓存。我使用以下代码来初始化缓存。
$tagCache = Zend_Cache::factory('Core',
'File',
array('automatic_serialization' => true),
array('cache_dir' => $cfg['instdir']. 'Cache_dir'));
$cache = Zend_Cache::factory('Capture',
'Static',
array(),
array('index_filename' => 'index',
'public_dir' => $cfg['instdir'] . 'Cached',
'tag_cache' => $tagCache));
我使用以下代码开始缓存:
$id = bin2hex($_SERVER["REQUEST_URI"]);
$cache->start($id, array());
缓存文件已生成,但我无法使用该remove()
方法删除它们(缓存不刷新):
$cache->remove($id); // id generated like above from the REQUEST_URI of the page I want to refresh
我究竟做错了什么 ?谢谢。