@njs2024 I don’t use Next.js or work for Netlify, but from what I’ve seen in my travels, I believe that more recent versions of Next.js don’t produce a “static site” unless you’re explicitly doing an “export” .
See posts like:
There’s no static files in Next.js 14 and Next.js Runtime v5: After Upgrading from Next.js 14.0 to 14.2 NetlifyCacheHandler.get fails - #5 by hrishikesh
Everything is server-rendered (output is stored in Netlify Blobs to cache and compare for future requests) and it would take long if your page generation logic takes long.
So SSG would work as follows:
During the build, page would be generated
It would be moved to Netlify Blobs before deployment
When the page is requested, it would be handle…
That header is for the browser: Better Living Through Caching (netlify.com)
Netlify uses the netlify-cdn-cache-control header: Caching | Netlify Docs
You can check the headers in the screenshot you sent:
cache-status: Netlify Durable; hit; fwd=stale
cache-status: Next.js; hit
cache-status: Netlify Edge; fwd=stale
That proves the caching is working as intended.
As I mentioned before, there are no static pages with Next.js 14 Please refer to the linked thread.
If you want st…
Currently, the Next.js Runtime v5 deletes all your Next.js-built HTML files from the deploy and uploads them to Netlify Blobs. Then, during the request time, the request is sent to the server handler where the HTML is downloaded from Blobs, processed by Next.js (checked for cache status) and a response is served.
I believe that’s what’s causing an issue in your case. On a surface level, this doesn’t appear to be related to the Next.js 14.2 upgrade, but we’ll keep checking.
There are no “truly static” routes in Next.js. Even those static files are revalidateable by Next.js so we have to let Next.js handle those assets and not serve those directly as static files. We have no means to know if a route would be revalidated in the future or not, and since Next.js allows revalidating static files, we have to follow that standard and allow revalidating static files on Netlify as well.
If you want a truly static outputI believe you’d have to use: Deploying: Static Exports…
So it may seem it’s a “static site”, but how it has been implemented to ensure various Next.js functionality has meant it’s no longer actually one.
1 Like