mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
请求缓存发送304
This commit is contained in:
@@ -1487,7 +1487,9 @@ class Request
|
|||||||
if (Cache::has($key)) {
|
if (Cache::has($key)) {
|
||||||
// 读取缓存
|
// 读取缓存
|
||||||
$content = Cache::get($key);
|
$content = Cache::get($key);
|
||||||
$response = Response::create($content)->header('Content-Type', Cache::get($key . '_header'));
|
$response = Response::create($content)
|
||||||
|
->code(304)
|
||||||
|
->header('Content-Type', Cache::get($key . '_header'));
|
||||||
throw new \think\exception\HttpResponseException($response);
|
throw new \think\exception\HttpResponseException($response);
|
||||||
} else {
|
} else {
|
||||||
$this->cache = [$key, $expire];
|
$this->cache = [$key, $expire];
|
||||||
|
|||||||
Reference in New Issue
Block a user