增加request_cache_expire配置参数用于配置全局的请求缓存有效期

This commit is contained in:
thinkphp
2016-11-01 18:06:58 +08:00
parent bef0eebaed
commit 12b9dad495
2 changed files with 3 additions and 1 deletions

View File

@@ -105,6 +105,8 @@ return [
'var_pjax' => '_pjax',
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
'request_cache' => false,
// 请求缓存有效期
'request_cache_expire' => null,
// +----------------------------------------------------------------------
// | 模板设置

View File

@@ -128,7 +128,7 @@ class App
// 监听app_begin
Hook::listen('app_begin', $dispatch);
// 请求缓存检查
$request->cache($config['request_cache']);
$request->cache($config['request_cache'], $config['request_cache_expire']);
switch ($dispatch['type']) {
case 'redirect':