Next.js Discord

Discord Forum

Treat Static Pages As SSG

Unanswered
Keyhole wasp posted this in #help-forum
Open in Discord
Keyhole waspOP
Hey everyone, I have two questions for which I am looking for answers.

1 - How do I make page SSG if I have only static content and html? Do I have to use getStaticPaths or getStaticProps to return an empty object as I will not be fetching anything, or will NextJS by default make static pages SSG?

2 - Will Next JS fetch SSG components that are cached on CDN in the background if the links to them appear in the viewport as Next JS does for SSR components?

3 Replies

Keyhole waspOP
So, I don't need to use getStaticProps and getStaticPaths explicitly if the page is static. Can you tell me how I can check if the page is serving from CDN or not?
that depends on the hosting provider, there isn't a universal answer