Closed luokelong closed 2 months ago
force-static
is not intended to be supported, this section should be linked to from an error you're probably seeing in your app. To implement static rendering properly, please follow the static rendering guide (theoretically, after you've set this up, force-static
might even work).
to make the cache-control attribute of the header set in the middleware take effect
Is that actually the case? That's quite interesting, I wonder if that behavior is intended.
force-static
is not intended to be supported, this section should be linked to from an error you're probably seeing in your app. To implement static rendering properly, please follow the static rendering guide (theoretically, after you've set this up,force-static
might even work).to make the cache-control attribute of the header set in the middleware take effect
Is that actually the case? That's quite interesting, I wonder if that behavior is intended.
The problem has been solved with your help, thank you very much.
Description
I used the "export const dynamic = "force-static"; " syntax in the server component to make the cache-control attribute of the header set in the middleware take effect. Unfortunately, at this time, using the "const t = await getTranslations();" or "const t= useTranslations();" methods in page.tsx will fail and the page will return a not found 404 page.
App Router with src dir
Verifications
Mandatory reproduction URL
App Router
Reproduction description
Steps to reproduce:
Expected behaviour
Work well