how can i see if each route / page is dynamic or static?
Answered
Elite posted this in #help-forum
EliteOP
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 static18 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 staticAnswer
that includes route handlers right
and normal pages
@Elite that includes route handlers right
yes. Happy to help
@B33fb0n3 yes. Happy to help
EliteOP
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.
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.
@Elite 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.
if they really should be static, you can add
export const dynamic = 'force-static' to make it static in every case@B33fb0n3 if they really should be static, you can add export const dynamic = 'force-static' to make it static in every case
EliteOP
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?
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
@B33fb0n3 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
EliteOP
Does it have any performance perks? Like loading faster
@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
EliteOP
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
EliteOP
Alr was just confused as to why it was made dynamic
@B33fb0n3 yea
EliteOP
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 🙂
EliteOP
alr nw