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

Client SDKs should cache feature flags #39

Closed
marandaneto opened this issue Oct 5, 2023 · 0 comments · Fixed by #61
Closed

Client SDKs should cache feature flags #39

marandaneto opened this issue Oct 5, 2023 · 0 comments · Fixed by #61
Labels
enhancement New feature or request Feature Flags

Comments

@marandaneto
Copy link
Member

marandaneto commented Oct 5, 2023

Description

  • When the decide API is called, update the values of the feature flags in the disk
  • Always read the cached feature flags if the decide API has not finished yet, e.g. during SDK init.
  • Consider maintaining a mirror of the feature flags in memory to avoid all the IO of reading flags every time (the caching and reading should be synchronized though.)

https://github.com/PostHog/posthog-js-lite/blob/4a707fdc660785c187e0bfd99ec2df1887afcf5c/posthog-core/src/index.ts#L955-L963

Worth noting that the Android SDK v2 also didn't cache the feature flags: just in memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature Flags
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant