You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 27, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,9 @@ module.exports = {
49
49
|:--:|:--:|:-----:|:----------|
50
50
|**`cacheDirectory`**|`{String}`|`path.resolve('.cache-loader')`|Provide a cache directory where cache items should be stored|
51
51
|**`cacheIdentifier`**|`{String}`|`cache-loader:{version} {process.env.NODE_ENV}`|Provide an invalidation identifier which is used to generate the hashes. You can use it for extra dependencies of loaders.|
52
+
|**`write`**|`{Function(cacheKey, data, callback) -> {void}}`|`undefined`|Allows you to override default write cache data to file (e.g. Redis, memcached).|
53
+
|**`read`**|`{Function(cacheKey, callback) -> {void}}`|`undefined`|Allows you to override default read cache data from file.|
54
+
|**`makeKey`**|`{Function(options, request) -> {string}}`|`undefined`|Allows you to override default cache key generator.|
52
55
53
56
<h2align="center">Examples</h2>
54
57
@@ -95,6 +98,82 @@ module.exports = {
95
98
}
96
99
```
97
100
101
+
### `Example of Database Integration`
102
+
103
+
**webpack.config.js**
104
+
```js
105
+
constredis=require('redis'); // Or different database client - memcached, mongodb, ...
0 commit comments