Static/cacheing help needed for dynamic pages
Answered
Transvaal lion posted this in #help-forum
Transvaal lionOP
I’m building an application where its all dynamic pages. Using the slug, I fetch data on the server and return a page with content from the fetched data. My app folder has the director [id] where this all happens
My questions are:
1) every time a user goes to ‘/{id}’ does the page get built at that moment or is it prebuilt? And does it get cached?
2) If I know all my ids before hand, is there way where I can build all static pages correlated with those ids?
I’m concerned with SEO and want my website to be as crawl-able as possible
My questions are:
1) every time a user goes to ‘/{id}’ does the page get built at that moment or is it prebuilt? And does it get cached?
2) If I know all my ids before hand, is there way where I can build all static pages correlated with those ids?
I’m concerned with SEO and want my website to be as crawl-able as possible
Answered by James4u
1 ) I think you can use ISR for those pages with slug (id) - mostly they are blogs or product detail pages which is dynamic with low frequency.
2) https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params Yeah you can!
2) https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params Yeah you can!
4 Replies
1 ) I think you can use ISR for those pages with slug (id) - mostly they are blogs or product detail pages which is dynamic with low frequency.
2) https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params Yeah you can!
2) https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#generating-static-params Yeah you can!
Answer
@Transvaal lion
Transvaal lionOP
Exactly what I needed, thank you!
Original message was deleted
Sure! @Transvaal lion please mark solution