diff --git a/convention.php b/convention.php index 23408722..8eb30f43 100644 --- a/convention.php +++ b/convention.php @@ -105,6 +105,8 @@ return [ 'var_pjax' => '_pjax', // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则 'request_cache' => false, + // 请求缓存有效期 + 'request_cache_expire' => null, // +---------------------------------------------------------------------- // | 模板设置 diff --git a/library/think/App.php b/library/think/App.php index 93d9ef6f..4eddc7cd 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -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':