-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Did caching #856
Did caching #856
Conversation
.executeTakeFirst() | ||
if (!res) return null | ||
const now = Date.now() | ||
const updatedAt = new Date(res.updatedAt).getTime() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Date
may not have to come into play here since res.updatedAt
is a unix timestamp itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah i had that as Date originally 🙃
|
||
export interface DidCache { | ||
did: string | ||
doc: DidDocument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it all good for tombstoned dids to be cached here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cleaned it up a bit so if we try to refresh & it's missing, we'll clear out the cache. should fix tombstoned dids 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent 👍!!
Split off from simple-service-auth for ease of review
This adds a Postgres DID cache to the appview building off of #842
We do stale-while-revalidate when TTL is passed & can override the cache for sensitive operations such as updating indexed handles