Skip to content

Cache Details (TTL? LRU?) #2750

Answered by msdrigg
RobertAron asked this question in Q&A
Discussion options

You must be logged in to vote

I was looking this over for myself (user, not maintainer), and from what I can tell the cache grows indefinitely.

I came to this conclusion because the default cache provider is a plain js Map object (

const [cache, mutate] = initCache(new Map()) as [Cache<any>, ScopedMutator]
). So unless there is some magic under the hood that I can't see, there is currently no built in support for TTL, LRU or anything. You would need to use a SwrConfigProvider and supply your own cache.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobertAron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants