Next.js Discord

Discord Forum

Limit the "use cache" in an LRU kind of way(?)

Unanswered
omermanman posted this in #help-forum
Open in Discord
Avatar
Hey, I want to fully utilize "use cache" it seems to be working as expected for me.
The issue here, is that if Im using large expiration times, the server can consume a lot of data in-memory.
Is there a way to limit the caching behavior to work as LRU? which would mean any entry may expire instantly once the in-memory cache is full.
this way I will allow my users to have the best experience and my resources wont choke.

Help(?)
** Currently to work around it i use relatively small values as the caching times.

0 Replies