How to clear Electric SQL cache on logout? #2994
-
|
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... |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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