Next.js Discord

Discord Forum

Next 13/14 Is it possible to set dynamic cache values based on response?

Unanswered
West African Lion posted this in #help-forum
Open in Discord
West African LionOP
So far I've seen a lot of options related to caching system in next js. But I haven't seen anything about cache based on api response in the docs or anywhere else.

use case: you fetching an api that returns a list of events

events that are from the past - caching "forever"
events that are from today - cache only 1 minute
events that are from the future - cache 1 day

Is this even possible to do with next? all I see is that its only possible to set an hardcoded value for caching

0 Replies