Accessing request Host / domain without accessing headers()
Unanswered
Grass Carrying Wasp posted this in #help-forum
Grass Carrying WaspOP
Hello,
I have a usecase where I need to serve the webpage under 2 urls (main domain and subdomain of it). Slightly different content needs to be loaded basing on the domain the request is served on. I don't want to use headers() to get the Host header and decide on it, becuase it forces page to be dynamic, while it can be fully static and cached by CDN. Domain is the only factor which decides about the content.
Next.JS gives me the error:
Any idea what I could use instead of headers?
I have a usecase where I need to serve the webpage under 2 urls (main domain and subdomain of it). Slightly different content needs to be loaded basing on the domain the request is served on. I don't want to use headers() to get the Host header and decide on it, becuase it forces page to be dynamic, while it can be fully static and cached by CDN. Domain is the only factor which decides about the content.
Next.JS gives me the error:
Page changed from static to dynamic at runtime /XXX/YYY, reason: headersAny idea what I could use instead of headers?