mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
路由cache参数支持数组 可以自定义缓存标识
This commit is contained in:
@@ -1413,7 +1413,14 @@ class Route
|
||||
}
|
||||
// 开启请求缓存
|
||||
if ($request->isGet() && !empty($option['cache'])) {
|
||||
$request->cache($pathinfo, $option['cache']);
|
||||
$cache = $option['cache'];
|
||||
if (is_array($cache)) {
|
||||
list($key, $expire) = $cache;
|
||||
} else {
|
||||
$key = $pathinfo;
|
||||
$expire = $cache;
|
||||
}
|
||||
$request->cache($key, $expire);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user