Hello,
we’re using the following setup:
nextjs application deployed as serverless using github actions and netlify cli (including netlify/plugin-nextjs). This page uses static rendering using getStaticProps and getStaticPaths and ISR with a revalidate prop set to 10 (so it also exports some functions).
The problem now is, that everything is totally fine on the preview page when deploying, but the production deployment often gets served old content from days ago. It’s the HTML that is outdated with links to hashed css files that don’t exist anymore. When using different browsers on the same machine one might encouter 4-5 different versions of the same resource served to you.
I’m totally unsure how this happens and what could cause these old caches from being served.
Here are some sample requests to the same resource using different browsers, just seconds apart. There was no deploy in between.
I’m not sure I’m seeing the error. The date in the header seems correct to me. Do you have a request ID header from a problematic page? We can check that further.
sure, currently on our main site one resource should serve an html page with f.e x-nf-request-id: 01F9XN5HJWN364HTJ5A73875TN which is displayed correctly.
But i can also get the following versions when requesting said resource which are outdated: x-nf-request-id: 01F9XN4B6X0N7VRFDZQZDTP7VN
I am having a similar issue. I have a page with revalidate=60 (a minute) but it does not get regenerated. It actually gets generated as static during build, and never again. What am I doing wrong.
I still do get the problem. If you go to my site, you will see a JSON text with server time. If you go to project root that time is “02/10/2023 16:02:10”, which is the latest release time. That seems to me it was statically generated during deploy, and build logs match that. If instead you go to healthz instead, it does display current time, or close to because revalidate is a min.
Both pages, root and healthz have the same values, almost identical code. It works on healthz does not on /
Hello again @hrishikesh . I now see my / (root) updated. Perhaps I have been looking at the stale version all along. I will try to collect a little more info and get back to you.
I think I know what happened. Could you please tell me if it makes sense?
We have a rather flaky backend and this getStaticProps is still not retrying. I realized the error handling was not setting the revalidate property. So I guess netlify used SSG instead of ISR, so I could expect no expiration nor regeneration.
If that’s the case, what makes more sense, after retries are in place but still fails, to return an error?