-
Notifications
You must be signed in to change notification settings - Fork 554
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
Preferences caching #2792
Preferences caching #2792
Conversation
repoRevCacheMaxTTL: envInt('PDS_REPO_REV_CACHE_MAX_TTL'), // milliseconds (use 0 to disable) | ||
preferencesCacheMaxTTL: envInt('PDS_REPO_REV_CACHE_MAX_TTL'), // milliseconds (use 0 to disable) |
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.
preferencesCacheMaxTTL: envInt('PDS_REPO_REV_CACHE_MAX_TTL'), // milliseconds (use 0 to disable) | |
preferencesCacheMaxTTL: envInt('PDS_PREFS_CACHE_MAX_TTL'), // milliseconds (use 0 to disable) |
const cachedPrefs = await ctx.preferencesCache?.get(requester) | ||
if (cachedPrefs) { | ||
const preferences = JSON.parse(cachedPrefs) | ||
return { | ||
encoding: 'application/json', | ||
body: { preferences }, | ||
} | ||
} |
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.
We still want to apply the scope here.
await ctx.preferencesCache?.set( | ||
requester, | ||
JSON.stringify(checkedPreferences), | ||
) |
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 believe this could cache different contents depending on the user's scope. Maybe it would be more straightforward to control the cache contents entirely on the read path as a read-through cache, and turn this into an invalidation.
No description provided.