How to clear Electric SQL cache on logout? #2994
Answered
by
KyleAMathews
pasha-omni
asked this question in
Questions
|
What is the recommended way of clearing any cached Electric data when the user logs out? In my scenario I have a proxy that modifies the shape request based on user's id -- which means that the same shape request from the client would return different response by the server. However, if the response from one user gets cached, and then another user logs in from the same computer, then they would see the cached data of the first user. This is rather disastrous, so ideally i'd like to clear any cached data upon user's logout... |
Answered by
KyleAMathews
Aug 20, 2025
Replies: 1 comment 3 replies
|
If you use a cookie or header authorization the browser will use a separate cache for requests for each logged in user. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We do want
publicas shapes should be cached by anything before your proxy e.g. nginx, a CDN, etc. Your proxy is what separates this inner world to the outer world & it's what should set the vary. I added a PR for the docs #3013