Closed caleblawrence closed 2 years ago
This is really odd - it did end up updating when I checked 30 minutes later. But it seemed to take a very long time. Even though I see it's running getStaticProps
from the function log it does not update the page when I go refresh it again.
Everyone once in a while I see it going back to really old version of the cache as well.
Hi. Can you share a link please?
Here is the repo: https://github.com/caleblawrence/isr-bug-example Vercel site: https://isr-bug-example.vercel.app/ Netlify site: https://elegant-brown-75e87c.netlify.app/
Thanks for the excellent repro! This is a bug, and I will have a fix out today. In the meantime you can work around it by setting the env var EXPERIMENTAL_ODB_TTL
to true and rebuilding.
Thank you! you guys are on it :)
This is released in version 4.4.1 of the build plugin. Can you confirm the fix works for you?
you mean 4.1.1
right @ascorbic? From what I'm seeing it still takes quite a bit (5 minutes maybe) to clear out the stale cache and refresh it with the new data from getStaticProps
. I see in the logs that getStaticProps
is running and generating a new time but it doesn't show up on the page for a while.
I'm double checking right now and I'm going to update and re-deploy the example solution just to make sure.
Yeah I confirmed the updated time still comes in a 2-5 minutes later than then getStaticProps
is run. That's not all that bad I suppose it's just a bit unexpected. In Vercel I can literally hit CMD + R twice in a row and I'll see the new page (assuming getStaticProps
runs pretty fast like it does here).
Updated example app: https://elegant-brown-75e87c.netlify.app/
Repo: https://github.com/caleblawrence/isr-bug-example
Hi @caleblawrence ,
Yes, 4.1.1
. Generally you should expect the updated content to be visible within 1 minute. It runs immediately, and requests from new CDN nodes will get the new data as soon as it's available (so within a second or so), but the node that made the revalidate request will have to wait til the stale content expires, which is up to 60 seconds. This optimises for real life performance by allowing more to be cached at the edge, though it does mean you don't get the ability to reload and see the new content immediately. More details are here: https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/isr.md
Got it. Ok cool thank you sir.
Summary
I can't get ISR to work with Netlify even though it's working on Vercel and locally. Example page:
If I look at the function logs for
Function ___netlify-odb-handler
I see:And this log appears every 60 seconds when I refresh the page like I would expect however the page never changes from the time when it was deployed (cache is never refreshed?).
Steps to reproduce
See summary
A link to a reproduction repository
No response
Plugin version
4.1.0
More information about your build
netlify.toml
)What OS are you using?
Mac OS
Your netlify.toml file
[build] publish = ".next"
[[plugins]] package = "@netlify/plugin-nextjs"
Your public/_redirects file
`_redirects`
```toml # Paste content of your `_redirects` file here ```Your
next.config.js
filemodule.exports = { reactStrictMode: true, images: { domains: ["imgurl.com"], }, };
Builds logs (or link to your logs)
Build logs
``` # Paste logs here ```Function logs
Function logs
``` # Paste logs here ```.next JSON files
generated .next JSON files
``` # Paste file contents here. Please check there isn't any private info in them # You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time. ```