-
Hello, I understood the basic usages of SWR on the web application.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think the cache lives entirely in memory and additional on disk if the fetch function cached some response data. When you fetch a lot of data you could think about pagination, since you rarely need all that data ready at any time. Previously fetched data will be discarded by the JS garbage collector if its no longer referenced (by you or swr). |
Beta Was this translation helpful? Give feedback.
-
Cache is stored solely in memory, there is no size limit (I have a PR open to add a limit to the amount of cached keys). In my experience, there is no need to worry about the size, most apps don’t fetch enough data to have a memory issue, if using something like Redux or storing in useState you don’t worry then you can probably don’t worry here. |
Beta Was this translation helpful? Give feedback.
Cache is stored solely in memory, there is no size limit (I have a PR open to add a limit to the amount of cached keys).
In my experience, there is no need to worry about the size, most apps don’t fetch enough data to have a memory issue, if using something like Redux or storing in useState you don’t worry then you can probably don’t worry here.