Created
February 7, 2025 14:05
-
-
Save sitefinitySDK/282856e50d4a6856daadd34a6ec0916b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!hasAuthCookie && !request.nextUrl.pathname.startsWith('/render-lazy')) { | |
const headers = request.headers; | |
headers.set('x-cached-route-processed', 'true'); | |
let url = new URL(request.url); | |
url.pathname = '/cached' + request.nextUrl.pathname; | |
return NextResponse.rewrite(url, { | |
request: { | |
headers: headers | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment