Vercel Deployment - Cache Issue
Unanswered
Chinese Alligator posted this in #help-forum
Chinese AlligatorOP
Hello,
I am experiencing an issue with my deployment to Vercel.
Running on "next": "^16.1.5",
I have cache components enabled and using Suspense boundaries where I am fetching data in my dashboard sections and noticed that in development, the caching behavior is as expected. When navigating back and forth different routes, I only see the skeletons once and then not again unless the cachelife expires or I revalidate path manually or call the tag.
The issue is that in production, I am seeing the skeletons on every route hit regardless. I put a console.log inside one of the functions that is being cached, and in the Vercel site logs for my project, it is being hit every single time. I should only see the console.log once but it seems like it's getting called.
I am unsure what it could be and attached a picture. I also ran npm build so get info on the routes and as expected, dashis the following: ◐ /dashboard
Menaing: (Partial Prerender) prerendered as static HTML with dynamic server-streamed content. So it's correct to be partial pre-rendered and suspense to hit once and cache it once and not see the skeletons again.
Any idea what it could be?
Thank you,
I am experiencing an issue with my deployment to Vercel.
Running on "next": "^16.1.5",
I have cache components enabled and using Suspense boundaries where I am fetching data in my dashboard sections and noticed that in development, the caching behavior is as expected. When navigating back and forth different routes, I only see the skeletons once and then not again unless the cachelife expires or I revalidate path manually or call the tag.
The issue is that in production, I am seeing the skeletons on every route hit regardless. I put a console.log inside one of the functions that is being cached, and in the Vercel site logs for my project, it is being hit every single time. I should only see the console.log once but it seems like it's getting called.
I am unsure what it could be and attached a picture. I also ran npm build so get info on the routes and as expected, dashis the following: ◐ /dashboard
Menaing: (Partial Prerender) prerendered as static HTML with dynamic server-streamed content. So it's correct to be partial pre-rendered and suspense to hit once and cache it once and not see the skeletons again.
Any idea what it could be?
Thank you,
4 Replies
I think vercel has its own caching layer that might be bypassing your Next.js cache.
@RxvxntxN I think vercel has its own caching layer that might be bypassing your Next.js cache.
Chinese AlligatorOP
Wonder why it's not noted in their docs. Unless I am blind and cannot find the answer when deploying to Vercel and having Cache Components enabled. I think it's a big miss on their end to clarify this distinction, if any.
@RxvxntxN Does this document help ?
https://evolutit.com/blog/nextjs
Chinese AlligatorOP
Not really. I know most of these features. It's primarily the deployment to Vercel so as suggested below. I will reach out to the Vercel Community forums.
Thank you!
Thank you!