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

infra: cache environment segments in production #3745

Merged

Conversation

matthewelwell
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

When evaluating the flags for an identity, the Core API retrieves only those segments which have been overridden in the current environment. It seems that, when the code was updated to use this method, the caching that existed for project segments wasn't updated to handle this new method of only retrieving the segments for an environment.

In an effort to reduce the impact on the Core API from traffic floods, this aggressively caches the segments for a given environment for 30 seconds in local memory on each of the Core API instances.

How did you test this code?

N/a

@matthewelwell matthewelwell requested review from a team and gagantrivedi and removed request for a team April 10, 2024 09:54
Copy link

vercel bot commented Apr 10, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 9:54am
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview Apr 10, 2024 9:54am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 9:54am

Copy link
Contributor

github-actions bot commented Apr 10, 2024

Uffizzi Preview deployment-49891 was deleted.

@matthewelwell matthewelwell added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit f2302ee Apr 10, 2024
9 checks passed
@matthewelwell matthewelwell deleted the chore(infra)/aggressively-cache-environment-segments branch April 10, 2024 10:25
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