You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem : Some times our database has few change in one day than means we can create static page with GetStaticProps method and pass revalidation to set time of need to wait for regenerating page.
For now this strategy is in the nextjs project.
But a problem is when we in dynamic route.
suppose in dynamic route we have 1000 page generated and revalidation method is going to regenerate all 1000 pages but we now at most 10 page have changes in one minute and we need regenerate 10 page not 1000 page
Solution : in revalidation property we can set a function instead of a number.
This function get a page id (suppose in dynamic route we in /page/:id ) and return true or false for regenerating page.
this strategy can remove high processing in server and in some kind of page we can transfer SSR page to SSG and it's awesome
Note: I see the planing for next version of the project and see your team want's add event listener for regenerating pages and for this it's better you create listener for each page of dynamics root (page/1, page/2 , ... ) and it's can improve the performance and app don't need regenerating all pages
Note 2 : I want to contributing for develop this strategy if it's possible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem : Some times our database has few change in one day than means we can create static page with GetStaticProps method and pass revalidation to set time of need to wait for regenerating page.
For now this strategy is in the nextjs project.
But a problem is when we in dynamic route.
suppose in dynamic route we have 1000 page generated and revalidation method is going to regenerate all 1000 pages but we now at most 10 page have changes in one minute and we need regenerate 10 page not 1000 page
Solution : in revalidation property we can set a function instead of a number.
This function get a page id (suppose in dynamic route we in /page/:id ) and return true or false for regenerating page.
this strategy can remove high processing in server and in some kind of page we can transfer SSR page to SSG and it's awesome
Note: I see the planing for next version of the project and see your team want's add event listener for regenerating pages and for this it's better you create listener for each page of dynamics root (page/1, page/2 , ... ) and it's can improve the performance and app don't need regenerating all pages
Note 2 : I want to contributing for develop this strategy if it's possible.
Beta Was this translation helpful? Give feedback.
All reactions