@tramvai/module-cache-warmup 1.56.0 → 1.57.1
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.
- package/README.md +13 -10
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Cache warmup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Module to execute warmup of the cache when app starts.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
By default, the module is already included in `@tramvai/module-server` and no additional actions are needed.
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
10
|
import { createApp } from '@tramvai/core';
|
|
@@ -15,11 +15,16 @@ createApp({
|
|
|
15
15
|
});
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Explanation
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
> Module is executed only when `NODE_ENV === production`.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
1. When app starts the module will request list of app urls from papi-route `bundleInfo`.
|
|
23
|
+
2. For every url from the response it sends `2` requests: one for mobile and one for desktop device. But only `2` requests are running simultaneously in total.
|
|
24
|
+
|
|
25
|
+
### User-agent
|
|
26
|
+
|
|
27
|
+
In order to emulate mobile or desktop device next user-agent strings are used:
|
|
23
28
|
|
|
24
29
|
```js
|
|
25
30
|
[
|
|
@@ -30,8 +35,6 @@ createApp({
|
|
|
30
35
|
];
|
|
31
36
|
```
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## Отладка
|
|
38
|
+
## Debug
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
This module logs with id `cache-warmup`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-cache-warmup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.57.1",
|
|
4
4
|
"description": "tramvai cache warmup module",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@tinkoff/url": "0.7.37"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@tramvai/core": "1.
|
|
29
|
-
"@tramvai/module-common": "1.
|
|
30
|
-
"@tramvai/state": "1.
|
|
31
|
-
"@tramvai/tokens-http-client": "1.
|
|
28
|
+
"@tramvai/core": "1.57.1",
|
|
29
|
+
"@tramvai/module-common": "1.57.1",
|
|
30
|
+
"@tramvai/state": "1.57.1",
|
|
31
|
+
"@tramvai/tokens-http-client": "1.57.1",
|
|
32
32
|
"tslib": "^2.0.3"
|
|
33
33
|
},
|
|
34
34
|
"module": "lib/server.es.js",
|