Next.js Discord

Discord Forum

how can i see if each route / page is dynamic or static?

Answered
Elite posted this in #help-forum
Open in Discord
how can i see if each route / page is dynamic or static?
Answered by B33fb0n3
when you build your app next build, you can see via the icons in front, if the specific route will be rendered dynamic or static
View full answer

18 Replies

@Elite how can i see if each route / page is dynamic or static?
when you build your app next build, you can see via the icons in front, if the specific route will be rendered dynamic or static
Answer
that includes route handlers right
and normal pages
@Elite that includes route handlers right
yes. Happy to help
@B33fb0n3 yes. Happy to help
hey so i just ran the command. im confused as to why my privacy policy page is dynamic and not static.
its a server rendered page.
wouldn't making it static make it load faster? (as its preloaded)

and same with my home page. it has some client components, but doesnt rely on anything dynamically. except like some hooks.
@B33fb0n3 if they really should be static, you can add export const dynamic = 'force-static' to make it static in every case
is there a reason it doesn't auto detect?
and also will it increase performance if I make it static, when I'm not doing anything like fetching data dynamically?
@Elite is there a reason it doesn't auto detect? and also will it increase performance if I make it static, when I'm not doing anything like fetching data dynamically?
If you make it force static, the only thing that will happen is, that it will generate a version during request time with the dynamic data from that point and it will create a html site (static version) of your page. This page will be served then
@Elite Does it have any performance perks? Like loading faster
Serving a static page instead of dnyamically building them can be faster
@B33fb0n3 Serving a static page instead of dnyamically building them can be faster
Alr so it’s probably worth me doing that to like my homepage right
@Elite Alr so it’s probably worth me doing that to like my homepage right
if that page should be served statically, yes
@B33fb0n3 if that page should be served statically, yes
Alr was just confused as to why it was made dynamic
@B33fb0n3 yea
Is there a reason as to why it was dynamic initially?
@Elite Is there a reason as to why it was dynamic initially?
To be able to answer that, I would need to see the whole code and I won't do that 🙂
alr nw