Support Forums

Invalid/old content served by netlify using serverless nextjs app

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 thankful for any advice you can give me to nail this problem down.

Hi @martin.juhasz,

The URL fro the image doesn’t seem to exist anymore for us to be able to test. Has something changed?

Hey, that url should not be visible. You can give it a try here: https://test-reboot-staging-5.netlify.app/test/martin

Are these the files your HTML is referencing to that are no longer in the latest deploy?


no, its about something different. this is just a WIP currently and related to next.

I’m talking that the html file itself alters its contents (watch the numbers in the big headline) or check the date in the header of the response.

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

Hey there, @martin.juhasz :wave:

Thanks for sharing the above details. We have taken this to our Nextjs team and they have a few questions that will help us dive into this further.

  1. Are you using fallback on your site? If you can confirm this, it will help us make some further connections here.
  2. Do you have a public repo that you can share with us for this?

Thank you!

Hi @martin.juhasz :wave:

We have rolled out a fix for this issue and it should now be resolved. Please let us know if you have any further questions.