好踢,這裏的問題:Zend的緩存不中
$frontendOptions = array(
'lifetime' => 7200,
'debug_header' => true, // for debugging, but it doesn't work...
'regexps' => array(
// Cache the static pages
'^/pages/' => array('cache' => true),
)
);
$backendOptions = $config->cache->backOptions->toArray();
// getting a Zend_Cache_Frontend_Page object
require_once 'Zend/Cache.php';
$cache = Zend_Cache::factory('Page',
$config->cache->backend,
$frontendOptions,
$backendOptions);
$cache->start();
這並不做任何事情。頁面加載時間完全相同,並且$backendOptions
中指示的文件夾爲空。我究竟做錯了什麼?
順便說一句:$config->cache->backend
讀取"file"
。
你是直接在bootfile或index.php文件上調用它嗎? – Chris 2009-09-30 20:32:24
究竟是/ pages /?你有一個「pageController()」?您可以嘗試'^/$'作爲正則表達式來測試匹配路徑是否存在問題。 錯誤日誌中的任何警告/錯誤/聲明? 你確定php有寫訪問到cachedirectory嗎? 而現在我可以想到的最後一件事情是:嘗試使用大寫'F'作爲後端的'文件'。 – smoove 2009-09-30 22:30:15