Open eatyourgreens opened 4 days ago
I think Zooniverse is running quite an old version of Next.js, so probably needs to manually set swrDelta
in the Next.js config. There have been a few bug fix releases since 14.2.7, including changes to how the duration is set for ISR revalidation.
I also think recent versions of Next.js set the revalidation time to one year by default.
More recently, the config key was renamed to expireTime
.
This is from 2022, so might be outdated now, but says that Azure Front Door doesn't support stale-while-revalidate
.
However, the related feature request is marked as completed.
Nginx might be the answer, in order to use ISR while self-hosting with AFD.
We'd also really like to see this in Front Door. Currently, we deploy an additional NGINX into our app service via Docker Compose to facilitate stale-while-revalidate for server-side rendered pages of our Next.js application.
Agreed. This will be addressed when upgrading Next 14 --> Next 15.
Package
Describe the bug
Neither of the Next.js apps set a duration for
stale-while-revalidate
. This means that Incremental Static Regeneration (ISR) won’t work as expected.To Reproduce
Go to https://www.zooniverse.org, or any project page served by Next.js, and inspect the response headers.
Expected behavior
stale-while-revalidate
must specify a duration in seconds. See the MDN page for Cache-Control.Additional context
This is a very old bug in Next.js, fixed in https://github.com/vercel/next.js/pull/61330
Vercel deployments work without the duration, but that's a non-standard feature specific to Vercel. CDNs like CloudFront support the standard. I don't know what support is like in Azure FrontDoor.