From 12b9dad4956f69defff09b628cb2d6199f69b142 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 1 Nov 2016 18:06:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0request=5Fcache=5Fexpire?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0=E7=94=A8=E4=BA=8E=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=85=A8=E5=B1=80=E7=9A=84=E8=AF=B7=E6=B1=82=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=9C=89=E6=95=88=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 ++ library/think/App.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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':