Skip to content

Feature request: don't make API requests if a valid cache is present #297

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

Open
rolodato opened this issue Mar 18, 2025 · 0 comments
Open

Comments

@rolodato
Copy link
Member

Currently, enabling cacheFlags still causes API requests to be made unless cacheOptions.skipAPI is also enabled. The intention is to speed up the initial load while updating flags in the background.

IMO this is not a reasonable default. Every cache implementation I've worked with will use the cache instead of calling the data source - this is exactly the goal of using any cache. One common reason for enabling caching is to reduce the number of API calls made, which does not actually happen when caching is enabled unless you also enable cacheOptions.skipAPI.

We should make cacheOptions.skipAPI: true the default behaviour and remove this option. If users want to repopulate their flags even when using caching, they should have the option to do that by manually calling a method such as getFlags.

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

No branches or pull requests

1 participant