NextJS website is not getting new content from Strapi

Hi,

I have my Strapi backend hosted on Heroku.

And my frontend is built using NextJS and hosted on Vercel.

I am using Static generation to build my frontend.

Whenever I write a new blog post on Strapi, I have to go to Vercel and rebuild the frontend.

My question is that is there a way that my frontend automatically reflects the new blog post and I don’t have to rebuild the website every time.

Thanks!

I suspect it’s because your site is statically generated at build? Are you using getStaticProps instead of getServerSideProps?

Or you could use a useEffect to fetch the data from Strapi from your front end.

1 Like

If you are using getStaticProps, you can also add the revalidate parameter to update every x seconds.

see Basic Features: Data Fetching | Next.js