slonik-interceptor-query-cache 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +24 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,17 +18,33 @@ Which queries are cached is controlled using cache attributes. Cache attributes
18
18
 
19
19
  ## Cache attributes
20
20
 
21
- |Cache attribute|Description|Required?|Format|Default|
22
- |---|---|---|---|---|
23
- |`@cache-ttl`|Number (in seconds) to cache the query for.|Yes|`/^d+$/`|N/A|
24
- |`@cache-key`|Cache key that uniquelly identifies the query.|No|`/^[$A-Za-z0-9\-_:]+$/`|`$bodyHash:$valueHash`|
25
- |`@cache-discard-empty`|If set to `true`, then `storage.set` is not invoked when query produces no results.|No|`/^(false|true)$/`|`false`|
21
+ #### `@cache-ttl`
26
22
 
27
- ### `@cache-key`
23
+ |Required|Format|Default|
24
+ |---|---|---|
25
+ |Yes|`/^d+$/`|N/A|
28
26
 
29
- Overrides the default cache key that uniquely identifies the query.
27
+ Number (in seconds) to cache the query for.
30
28
 
31
- If present, `$bodyHash` is substituted with the hash of the query (comments and white-spaces are stripped before hashing the query). `$valueHash` is substituted with the hash of the parameter values.
29
+ #### `@cache-key`
30
+
31
+ |Required|Format|Default|
32
+ |---|---|---|
33
+ |No|`/^[$A-Za-z0-9\-_:]+$/`|`$bodyHash:$valueHash`|
34
+
35
+ Cache key that uniquely identifies the query.
36
+
37
+ If present, `$bodyHash` is substituted with the hash of the query (comments and white-spaces are stripped before hashing the query).
38
+
39
+ If present, `$valueHash` is substituted with the hash of the parameter values.
40
+
41
+ #### `@cache-discard-empty`
42
+
43
+ |Required|Format|Default|
44
+ |---|---|---|
45
+ |No|`/^(false|true)$/`|`false`|
46
+
47
+ If set to `true`, then `storage.set` is not invoked when query produces no results.
32
48
 
33
49
  ### Example usage
34
50
 
package/package.json CHANGED
@@ -67,5 +67,5 @@
67
67
  "test:ava": "nyc ava --verbose --serial"
68
68
  },
69
69
  "typings": "./dist/src/index.d.ts",
70
- "version": "3.1.0"
70
+ "version": "3.2.0"
71
71
  }