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