I want to deploy a next project outside of Vercel and am confused how cache is working. When accessing the url for a page with ISR enabled I can confirm the db is in fact not accessed before the revalidate period isn't over but
First question : The generated page seems to live in .next/server/pages/mypage.html (and mypage.json) however when checking the devtools after requesting the page's url I can only see multiple requests to .next/static/* and .next/static/chunks/pages/* which seems to be files generated at build time that don't know anything about what has been regenerated by ISR when accessing the database, I can't find anything related to .next/server/pages. Can someone explain me that ?
Second question : If it's accessed from .next/server is it possible to cache through a CDN since NextJS' docs advice just to host .next/static on the CDN ?
The exact configuration for uploading your files to a given CDN will depend on your CDN of choice. The only folder you need to host on your CDN is the contents of .next/static/, which should be uploaded as _next/static/ as the above URL request indicates. Do not upload the rest of your .next/ folder, as you should not expose your server code and other configuration to the public.
https://nextjs.org/docs/api-reference/next.config.js/cdn-support-with-asset-prefix
Thanks in advance.
documentbeing fetched (the HTML page), that's the HTML (re)generated on the server by ISR. Only assets (_next/static/) should be served by the CDN.