Next.js Discord

Discord Forum

Next.js / Vercel Datacache randomly hiccups

Unanswered
West African Lion posted this in #help-forum
Open in Discord
Avatar
West African LionOP
I am getting a weird bug where every few reloads or so the Datacache takes really long to respond. The normal response time is 50ms avg, and then it will hiccup and hit 400ms avg.

I am logging anytime the cache gets reloaded too and it's not being reloaded when the hiccup happens.

Also on my local machine, the data cache never hiccups and it takes sub 5ms to respond.
Image

10 Replies

Avatar
West African LionOP
For context here is my home page code (what I am testing against)
Image
Image
This is a big deal for me because I am relying on the cache to return responses faster than 50ms
And I am forced to use unstable_cache (which is what fetch is using under the hood probably) because when I use Prismic's built in cache support, I am getting avg load times of 100ms + the hiccups.
Could the hiccup be due to vercel's database they use for caching being overloaded?
From what I understand localy they use file based caching (.next/cache/fetch-cache/)
And then on their server they use some sort of "database/datacache"
Avatar
West African LionOP
Just for context here's some more log examples
Image
These are all within the same minute
Avatar
West African LionOP
Made some tests with just a time cache... 250ms for a cache load
Image
Image
Image
I would much rather use the file system cache over vercel's "Datacache" at this point