fix: cache control에서 expires가 남는 문제 수정
This commit is contained in:
@@ -98,12 +98,14 @@ class APIHelper
|
|||||||
header('cache-control: private, max-age=86400');
|
header('cache-control: private, max-age=86400');
|
||||||
header("Pragma: cache");
|
header("Pragma: cache");
|
||||||
header("HTTP/1.1 304 Not Modified", true, 304);
|
header("HTTP/1.1 304 Not Modified", true, 304);
|
||||||
|
header_remove('expires');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
if ($reqEtags !== null && $reqEtags === $etag) {
|
if ($reqEtags !== null && $reqEtags === $etag) {
|
||||||
header('cache-control: private, max-age=86400');
|
header('cache-control: private, max-age=86400');
|
||||||
header("Pragma: cache");
|
header("Pragma: cache");
|
||||||
header("HTTP/1.1 304 Not Modified", true, 304);
|
header("HTTP/1.1 304 Not Modified", true, 304);
|
||||||
|
header_remove('expires');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,6 +114,7 @@ class APIHelper
|
|||||||
if ($setCache) {
|
if ($setCache) {
|
||||||
header('cache-control: private, max-age=86400');
|
header('cache-control: private, max-age=86400');
|
||||||
header("Pragma: cache");
|
header("Pragma: cache");
|
||||||
|
header_remove('expires');
|
||||||
}
|
}
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
@@ -121,6 +124,7 @@ class APIHelper
|
|||||||
if ($setCache) {
|
if ($setCache) {
|
||||||
header('cache-control: private, max-age=86400');
|
header('cache-control: private, max-age=86400');
|
||||||
header("Pragma: cache");
|
header("Pragma: cache");
|
||||||
|
header_remove('expires');
|
||||||
}
|
}
|
||||||
Json::die($result, $setCache ? 0 : Json::NO_CACHE);
|
Json::die($result, $setCache ? 0 : Json::NO_CACHE);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user