Is there a way to force static rendering when getServerSideProps is present? #12987
Unanswered
davidbarratt
asked this question in
Help
Replies: 2 comments 7 replies
-
Maybe I could have a custom Document and do it that way? Maybe call a method of a different name? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you considered using https://nextjs.org/blog/next-9-4#incremental-static-regeneration-beta |
Beta Was this translation helpful? Give feedback.
7 replies
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.
-
I want to have a page that is render staticlly and dynamiclly. The reason I want to do this is because I want to have the HTTP Cache offer a stale-while-revalidate strategy.
If user vists
/[..slug]
I want to send them the default page (and the API request will be made on the client). The next visitor will get the cached version so they can skip the API request, but will again update the content after the request has been returned.In addition, I do not want the client to call on routing
getServerSideProps()
over HTTP, I want it to fallback to it's client-side request.To put it another way, I want to force static generation, but when requested through the server, I want it to get the props.
Is there a way to do this? I thought about using the
fallback
option ongetStaticPaths()
but I don't actually want it to generate new HTML pages, I just want it to rungetServerSideProps()
if that is present.Beta Was this translation helpful? Give feedback.
All reactions