这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@rolodato

Description

@rolodato

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions