我正在使用代码片段来缓存整个页面:Zend Framework:Zend_Cache_Frontend_Page在使用get参数时不缓存
<?php
// Cache engine
// Cache everything outputed on the page for 2 minutes
// in the tmp folder
require_once 'Zend/Cache.php';
$frontendOptions = array(
'lifetime' => 120,
'automatic_serialization' => true,
'cache_with_get_variables' => true,
'cache_with_post_variables' => true,
'cache_with_session_variables' => true,
'cache_with_files_variables' => true,
'cache_with_cookie_variables' => true
);
$backendOptions = array(
'cache_dir' => '../tmp/'
);
$cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
$cache->start();
echo date("D M j G:i:s T Y");
?>
如果我使用以下命令调用页面: http://localhost/myapp/cache.php 它完美地工作
如果我使用get参数调用页面: http://localhost/myapp/cache.php?test=5 页面未缓存
我使用ZF 1.11.0
感谢您的帮助!
您救了我的命! – poiuytrez 2011-06-01 22:07:38