Static pages when root layout has force-dynamic #66275
Unanswered
Jetoxixoxorix
asked this question in
Help
Replies: 1 comment 1 reply
-
Hello, have you found a solution to this problem? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We have an app with app router. We have one app but we are using different subdomains for some clients. And depending on subdomain we are loading configuration from json files. We don't want to generate most of the layouts/pages at build time because we don't know subdomain then. Because of that in root layout we have:
export const dynamic = 'force-dynamic';
Then in root layout we get the right configuration and save it in context and use it in other parts of app.
The problem is that we have some parts of app that don't use the configuration and could be static and generated at build time.
But because of 'force-dynamic' in root layout everything is dynamic. Using 'force-static' in other layouts/pages do nothing.
Is it possible to have some static pages when root layout is dynamic? Maybe there is other solution?
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions