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.
<p>Caches the result of following loaders on disk</p>
13
+
<p>Caches the result of following loaders on disk (default) or in the database</p>
14
14
</div>
15
15
16
16
<h2align="center">Install</h2>
@@ -47,8 +47,11 @@ module.exports = {
47
47
48
48
|Name|Type|Default|Description|
49
49
|:--:|:--:|:-----:|:----------|
50
-
|**`cacheDirectory`**|`{String}`|`path.resolve('.cache-loader')`|Provide a cache directory where cache items should be stored|
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.|
50
+
|**`cacheDirectory`**|`{String}`|`path.resolve('.cache-loader')`|Provide a cache directory where cache items should be stored (used for default read/write implementation)|
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. (used for default read/write implementation)|
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