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

Use ExpirableLRU to cache http requests with TTL #789

Merged
merged 4 commits into from
Dec 15, 2022

Conversation

neelvirdy
Copy link
Contributor

  1. Adds two ExpirableLRU caches for caching certain http requests with two options of TTL (10 seconds, 60 minutes).
  2. Uses the 10 second cache for: /content/contents, /content/staging-zones/*, part of /public/stats
  3. Uses the 60 minute cache for: rest of /public/stats, /public/metrics/deals-on-chain

Note: I only included the 10 second cache for apiV2 because the extended cache endpoints should be moved to metrics API, and I'm not expecting them to be rewritten under apiV2. So, there's no need for the extended cache there.

@neelvirdy neelvirdy requested a review from en0ma December 15, 2022 23:03
alvin-reyes
alvin-reyes previously approved these changes Dec 15, 2022
Copy link
Contributor

@alvin-reyes alvin-reyes left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@alvin-reyes alvin-reyes left a comment

Choose a reason for hiding this comment

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

LGTM

@alvin-reyes alvin-reyes merged commit baec8c4 into application-research:dev Dec 15, 2022
@neelvirdy neelvirdy deleted the nvirdy/caching branch January 3, 2023 15:34
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

2 participants