0

On my website, I have [articleKey].tsx page, where I download current articles from the backend and show them on the screen.

export async function getStaticProps({locale, req, res}) {
    const articles = await requestArticles({lang: locale})
    generateRssFeedFiles(articles, locale)
    return {
        props: {articles},
        revalidate: 5 * 60
    }
}

I expect it to get current data every 5 minutes. It is important because those articles change over time. But I observe that sometimes I a change is not applied for more than a day until I manually redeploy the application. So it seems, this it not refreshing every 5 minutes. How to make it better? I don't want to use getServerSideProps to not make users wait, but at the same time I need this page to have fresh data.

MarcinM
  • 428
  • 7
  • 15
  • Where the website is hosted? is it a free plan or a premium plan? – DevAB Aug 18 '21 at 09:33
  • "I expect it to get current data every 5 minutes" - To clarify, the revalidation only occurs if a new request comes in, it won't automatically regenerate the page by itself. After the 5 minutes window, the next request will still show the cached page, and Next.js triggers a regeneration in the background. – juliomalves Aug 18 '21 at 14:24
  • It is hosted on Vercel, a premium plan. – MarcinM Aug 19 '21 at 06:40
  • @juliomalves This is not the thing. I checked many times during the day to check if it will finally update by itself. – MarcinM Aug 19 '21 at 06:42
  • @MarcinM did you solve this? I have a similar problem. – Degusto Sep 26 '22 at 09:10

0 Answers0