fix: change to permanent redirects were applicable

This commit is contained in:
Michael Zetterberg
2025-05-27 13:39:30 +02:00
parent efbed53be4
commit 528fbbce4a
5 changed files with 12 additions and 4 deletions

View File

@@ -54,9 +54,10 @@ export const middleware: NextMiddleware = async (request) => {
if (matchedRedirect) {
const newUrl = new URL(matchedRedirect, getPublicNextURL(request))
headers.set("Cache-control", "public, max-age=60")
headers.set("Cache-control", "public, max-age=14400") // 4 hours
return NextResponse.redirect(newUrl, {
headers,
status: 308,
})
}
headers.set("x-continue", "1")