perf(html): fix Cache-Control on response headers (was on request)
This commit is contained in:
1 parent
7c1f8d709e
commit
cc02851be3
1 file changed
+4
-4
+4
-4
@@ -38,20 +38,20 @@ export const proxy = async (req: import("next/server").NextRequest) => {
|
|||||||
"";
|
"";
|
||||||
if (ip) headers.set("x-real-client-ip", ip);
|
if (ip) headers.set("x-real-client-ip", ip);
|
||||||
|
|
||||||
|
const response = NextResponse.next({ request: { headers } });
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
headers.set(
|
response.headers.set(
|
||||||
"Cache-Control",
|
"Cache-Control",
|
||||||
"private, no-cache, no-store, max-age=0, must-revalidate",
|
"private, no-cache, no-store, max-age=0, must-revalidate",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
headers.set(
|
response.headers.set(
|
||||||
"Cache-Control",
|
"Cache-Control",
|
||||||
"public, max-age=60, s-maxage=300, stale-while-revalidate=300",
|
"public, max-age=60, s-maxage=300, stale-while-revalidate=300",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = NextResponse.next({ request: { headers } });
|
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(SECURITY_HEADERS)) {
|
for (const [key, value] of Object.entries(SECURITY_HEADERS)) {
|
||||||
response.headers.set(key, value);
|
response.headers.set(key, value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user