-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (cache): impl. soft-delete of users in cache
Previously, when all the auth tokens for a user where deleted, we deleted the user along with all the cached resources for that user. This can create a lot of churn in the cache, especially if the auth tokens have a short TTL (like 8 hrs), which can cause all the resources to be reloaded every morning when the user logs in. This change introduces a soft-delete of users in the cache. When all the auth tokens for a user are deleted, but there's still a valid refresh token that's less than 20 days old, we mark the user as deleted in the cache and do not return the user in the list of users returned by the cache, but we still keep the user in the cache (all all their cached resources). This way, when the user logs in again, we can just mark the user as active again and not have to reload all the resources. If the refresh token is older than 20 days, we delete the user from the cache along with all their cached resources.
- Loading branch information
Showing
9 changed files
with
469 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.