File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 22
33Cache layer compatible with express framework.
44
5- ### Install
5+ ## Install
66
7- ##### First step:
7+ #### First step:
88Install the main package:
99```
1010npm install node-cache-layer --save
1111```
1212
13- ##### Second step:
13+ #### Second step:
1414Install the handler desired to store the cache:
1515
1616** Redis** :
@@ -29,7 +29,7 @@ npm install cache-layer-filesystem --save
2929```
3030
3131
32- ### Using
32+ ## Usage
3333
3434Seamless integration without any major change in your application.
3535It caches the entire body response and the headers as well.
@@ -48,7 +48,7 @@ Complete options:
4848app .use (
4949 cache ({
5050 config_file: " ./path/config.json" , // If you prefer not to use the default location
51- isCacheable (req : any ) { // Custom function to define if the response can be cached
51+ isCacheable (req : any ) { // Custom function to define whether the response can be cached
5252 if (req .query .is_preview == " 1" )
5353 return false ;
5454
@@ -58,7 +58,7 @@ app.use(
5858);
5959```
6060
61- #### Config File
61+ ### Config File
6262
6363The default config file is located at the application root.
6464It's a JSON named "** cache-config.json** ".
@@ -98,7 +98,7 @@ It's a JSON named "**cache-config.json**".
9898}
9999```
100100
101- #### General properties
101+ ### General properties
102102Property | Description | Type | Example | Default Value
103103------------ | ------------- | ------------- | -------------
104104prefix | If you want to prefix the record id/key to store. In case of databases with the concept of tables/collections, this will be used to name it. | string | ` prefix: "cache_" ` | cache_
You can’t perform that action at this time.
0 commit comments