@aaqilniz/rest-cache
v2.0.0
Published
This is a loopback 4 based extension that implements caching mechanism.
Downloads
14
Readme
rest-cache
Installation
Install RestCacheComponent using npm
;
$ [npm install | yarn add] @aaqilniz/rest-cache
Basic Use
Configure and load RestCacheComponent in the application constructor as shown below.
import {RestCacheComponent, RestCacheComponentOptions, DEFAULT_REST_CACHE_OPTIONS} from 'rest-cache';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options: ApplicationConfig = {}) {
const opts: RestCacheComponentOptions = DEFAULT_REST_CACHE_OPTIONS;
this.configure(RestCacheComponentBindings.COMPONENT).to(opts);
// Put the configuration options here
});
this.component(RestCacheComponent);
// ...
}
// ...
}