Custom ttl function #231
Closed
emilioestebanez
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Hi @emilioestebanez, I apologize for the delay in my response. I believe your idea is feasible, and I plan to test it soon. Thank you! |
Beta Was this translation helpful? Give feedback.
1 reply
-
@emilioestebanez Hi there! I've created PR #249 with an emulation of the SWR strategy. Could you take a look and let me know what you think? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now, if we use the Redis/LRU handlers with
useTtl: true
, then the data is stored for the same amount of time as the revalidation value from Next.js.I'd like to be able to use stale-while-revalidate with a ttl for stale data (without having to disable
useTtl
because that would store stale data infinitely).For example if I use
revalidate: 60
, I'd like to use a ttl of 90. That way it'd behave likeCache-Control: max-age=60 stale-while-revalidate=30
:Is it possible to configure a ttl time with a custom function in the options? For example, something like:
Beta Was this translation helpful? Give feedback.
All reactions