Flagsmith / Flagsmith/flagsmith-js-client

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

Open
#297 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
67
Forks
45
Avg merge
1d 8h
Merged PRs (30d)
4

Description

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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.