slonik-interceptor-query-cache 3.0.0 → 3.1.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 +7 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,9 +21,15 @@ Which queries are cached is controlled using cache attributes. Cache attributes
21
21
  |Cache attribute|Description|Required?|Format|Default|
22
22
  |---|---|---|---|---|
23
23
  |`@cache-ttl`|Number (in seconds) to cache the query for.|Yes|`/^d+$/`|N/A|
24
- |`@cache-key`|Uniquelly identifies the query. Overrides the default cache key that uniquely identifies the query. 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.|No|`/^[$A-Za-z0-9\-_:]+$/`|`$bodyHash:$valueHash`|
24
+ |`@cache-key`|Cache key that uniquelly identifies the query.|No|`/^[$A-Za-z0-9\-_:]+$/`|`$bodyHash:$valueHash`|
25
25
  |`@cache-discard-empty`|If set to `true`, then `storage.set` is not invoked when query produces no results.|No|`/^(false|true)$/`|`false`|
26
26
 
27
+ ### `@cache-key`
28
+
29
+ Overrides the default cache key that uniquely identifies the query.
30
+
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.
32
+
27
33
  ### Example usage
28
34
 
29
35
  This example shows how to create a compatible storage service using [`node-cache`](https://www.npmjs.com/package/node-cache).
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.0.0"
70
+ "version": "3.1.0"
71
71
  }