Skip to content
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

cache me api response in redis #3746

Closed
wants to merge 3 commits into from
Closed

cache me api response in redis #3746

wants to merge 3 commits into from

Conversation

sywhb
Copy link
Contributor

@sywhb sywhb commented Mar 28, 2024

No description provided.

Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
omnivore-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2024 2:08pm
omnivore-prod ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2024 2:08pm

@jacksonh
Copy link
Contributor

I think we also might need to invalidate the cache when the user features change

@sywhb
Copy link
Contributor Author

sywhb commented Mar 28, 2024

I think we also might need to invalidate the cache when the user features change

Yeah that is a good one

@sywhb
Copy link
Contributor Author

sywhb commented Mar 28, 2024

I think we also might need to invalidate the cache when the user features change

Actually features are not cached because they are not queried from the function_resolver

if (!features) {
features = await findUserFeatures(ctx.claims.uid)

await cacheFeatures(ctx.claims.uid, features)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to await for the caching to be completed? Can't this happen in the asynchronously ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally we await on all our backend functions, one reason is it can better handle errors.

@jacksonh
Copy link
Contributor

I will close this one as I think it didn't quite handle some of the edge cases we came up with.

@jacksonh jacksonh closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants