Next.js Discord

Discord Forum

Caching question

Answered
In&Out posted this in #help-forum
Open in Discord
Hey folks, i have a question about caching. I want to fetch data from database, often but also often the data fetched will be same, can i use nextjs cache for this or redis? Which one would be better for bigger data?
Answered by Roseate Spoonbill
We have a client who has tens of thousands of posts on their blog, and those are revalidated pretty much on any change in the admin UI via webhooks. We haven't had any complaints about it nor did we experience performance impact.
View full answer

8 Replies

American black bear
Depends what do you mean by "bigger data". For most of the situations next.js cache will be enough and reduce complexity
You reckon redis is overreach for this?
Roseate Spoonbill
I'd say 500 objects is pretty much nothing when fetched every couple hours. I'd start from simple revalidate time and just observe the performance of the app. In production mode (build && serve) you wouldn' probably see too much of a performance impact. I would however observe vercel (if you use it) usage and limits to see if there aren't any cumulating charges.
Roseate Spoonbill
We have a client who has tens of thousands of posts on their blog, and those are revalidated pretty much on any change in the admin UI via webhooks. We haven't had any complaints about it nor did we experience performance impact.
Answer
@In&Out You reckon redis is overreach for this?
American black bear
what rafal said
start simple then fix if needed
alright, thanks you two