Next.js Discord

Discord Forum

Is there a way to bust the cache for statically generated pages and regenerating them ?

Unanswered
GuitarNerd posted this in #help-forum
Open in Discord
Hi everyone!

I have a Next app which has a mix of dynamically and statically generated pages and the backend is a Django app. The statically generated pages are my website’s products which rarely get updated so I’m fetching at build time from Django and generating the pages.

I currently have two problems:
1- Every time in the backend the data gets seeded again and the data’s hash ids(the visible ids for the frontend, not the actual id) get updated. Next.js still has outdated hash ids causing the website to crash
2- When a new medication is added or a previous one is removed it doesn’t get reflected. This will happen very rarely in production so I don’t want to remove the static generation.

In my view this is a devops problem. Whenever a new backend is published a rebuild should happen for Next.js. Is there anyway in Next.js to manually regenerate static pages ?

Thanks

0 Replies