Here's a scenario;
I am adding some static pages in Next.js, so using getStaticProps()
sounds good.
But, a user(admin) can also update [from an admin console] the content of these page in future, not very frequently.
So, Is there any way to refresh or re-deploy the pages only after the changes happen?
or, if We can add a button
on admin console to refresh/re-deploy after changes!?
Update: All the Page Content is getting stored in Database, and Next.js fetch the data from DB during build process.
My Approach:
use
revalidate
withgetStaticProps()
. But, it also doesn't gurantee immediate update, and importantly, causes unnecessary revalidation, as the changes are rare.Use
getServerProps()
As already said, the changes are occasional, it doesn't sounds best to me to usegetServerProps()
.
Thanks!