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

feature request: add useCache-default property #77

Closed
K-e-l-v-i-n-12 opened this issue Sep 11, 2022 · 1 comment
Closed

feature request: add useCache-default property #77

K-e-l-v-i-n-12 opened this issue Sep 11, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@K-e-l-v-i-n-12
Copy link

In the previous versions of ngx-hateoas-client, the cache is activated (true) by default. For individual calls, the cache can be (de)activated by GetOptions (useCache).

If required, the cache can also be disabled globally by HateoasConfiguration.cache.enabled. In this case, the caching is deactivated - even if GetOptions.useCache = true is set.

If you now want to develop an application that executes all calls without caching by default and only one specific call with caching, then useCache: false must be set in all calls.

Feature request:
Introduced a possibility to set the default value for GetOptions.useCache. Completely independently, however, there should still be the option of hard deactivating the cache for all methods via the HateoasConfiguration.

@lagoshny lagoshny self-assigned this Sep 19, 2022
@lagoshny lagoshny added the enhancement New feature or request label Sep 19, 2022
@lagoshny
Copy link
Owner

@K-e-l-v-i-n-12 ,

In versions 3.3.4 and 2.6.4 added support to specify cache mode. Now you can use configuration like this:

    hateoasConfig.configure({
      ....
      cache: {
        enabled: true,
        mode: CacheMode.ON_DEMAND
      }
    });

After that, only in methods that you have passed useCache=true will be use cache, other methods will not use cache.

Available two modes: ALWAYS it is by default and ON_DEMAND. Read more about it here.

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

No branches or pull requests

2 participants