Prefix all cache keys via SWRConfig #2795
Unanswered
SokratisVidros
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a multi-session application that works similarly to Gmail the data of a
/v1/emails
endpoint should be cached per session (or user). In Clerk, we have a similar scenario, and we append the session_id as a query parameter to the cache key/v1/emails?session_id=42
to prevent the stale data from one session from flicking into another.It would be great to prefix all cache keys globally with the session_id and make useSWR invocations more straightforward.
Is there maybe a better way to address this without having to provide a custom cache implementation?
Beta Was this translation helpful? Give feedback.
All reactions