Data cache doesn't seem to be used in builds

Data cache doesn’t seem to be used in my builds, even if I redeploy the same deployment using the existing build cache. If I build locally, the data cache is used and the build finishes in seconds. On Vercel, it still looks like it’s re-doing all requests and not using any cache. In the usage section, there are very few hits as well. I cannot wrap my head around this, since locally everything seems to work just fine. What is it that may influence data cache usage during builds that I am missing?

Hey, @linkyndy! Welcome to the Vercel Community :smile:

Could you share more information about your project / set-up? It’d help us understand if there’s anything in your configuration that is the issue.

Hi @pawlean, thank you!

Of course. It’s a static Next.js-powered site, with a few hundred pages being built at deploy time. Each page does several queries to Notion’s API to get relevant information. This information rarely changes, thus, at the moment, everything fetch()ed from Notion is force-cached.

If I purge all cache and build the site locally, it take a few minutes. Subsequent builds are really fast (<10s). On Vercel, however, fresh builds are close to the 45min limit, while subsequent ones take 20-25-30min.

On top of everything, since force-cacheing everything, Vercel’s Data Cache usage graphs show very little activity; very few reads, no writes, just a couple of hits (out of hundreds of different URLs) and no misses, which confuses me even further.

I’d be eager to hear any tips/pointers on what I could consider to debug/figure this out, as I’ve run out of ideas after a week.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.