I am using Next.js 15 for my website and Strapi CMS to manage its content. I have set up a webhook in Strapi that triggers and calls a custom API in my Next.js app whenever content is updated. This mechanism is intended to ensure that the updated content is reflected on the site.
However, I’m facing an issue related to SSG (Static Site Generation). After deploying a new build, most of the content displays correctly, but on a few specific pages, outdated content is shown — content that seems to be from an earlier version of the CMS. These pages do not reflect the latest changes made in Strapi, even though the CMS holds the correct, updated data.
To work around this, I have to manually open the problematic page in Strapi, make a small edit (just enough to enable the save button), and save the content again. After doing this and refreshing the page on the website, the updated content appears as expected.
I noticed that this issue occurs only when I build the app without deleting the previous .next build folder. Recently, I tried deleting the .next folder before generating a new build, and after that, all the pages — including the previously problematic ones — started displaying the correct, updated content.
I’d like to understand:
Why is this happening?
Is there a caching issue related to the build or ISR?
What is the proper way to ensure all content is correctly updated in the build, especially for SSG pages?