@modern-js/server-core 2.60.1 → 2.60.3
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.
|
@@ -26,6 +26,7 @@ var import_storer = require("@modern-js/runtime-utils/storer");
|
|
|
26
26
|
var import_constants = require("../../constants");
|
|
27
27
|
var import_utils = require("../../utils");
|
|
28
28
|
const ZERO_RENDER_LEVEL = /"renderLevel":0/;
|
|
29
|
+
const NO_SSR_CACHE = /<meta\s+[^>]*name=["']no-ssr-cache["'][^>]*>/i;
|
|
29
30
|
async function processCache({ request, key, requestHandler, requestHandlerOptions, ttl, container, cacheStatus }) {
|
|
30
31
|
const response = await requestHandler(request, requestHandlerOptions);
|
|
31
32
|
const decoder = new TextDecoder();
|
|
@@ -36,7 +37,7 @@ async function processCache({ request, key, requestHandler, requestHandlerOption
|
|
|
36
37
|
let html = "";
|
|
37
38
|
const push = () => reader.read().then(({ done, value }) => {
|
|
38
39
|
if (done) {
|
|
39
|
-
const match = ZERO_RENDER_LEVEL.test(html);
|
|
40
|
+
const match = ZERO_RENDER_LEVEL.test(html) || NO_SSR_CACHE.test(html);
|
|
40
41
|
if (match) {
|
|
41
42
|
writer.close();
|
|
42
43
|
return;
|
|
@@ -7,6 +7,7 @@ import { createMemoryStorage } from "@modern-js/runtime-utils/storer";
|
|
|
7
7
|
import { X_RENDER_CACHE } from "../../constants";
|
|
8
8
|
import { createTransformStream, getPathname } from "../../utils";
|
|
9
9
|
var ZERO_RENDER_LEVEL = /"renderLevel":0/;
|
|
10
|
+
var NO_SSR_CACHE = /<meta\s+[^>]*name=["']no-ssr-cache["'][^>]*>/i;
|
|
10
11
|
function processCache(_) {
|
|
11
12
|
return _processCache.apply(this, arguments);
|
|
12
13
|
}
|
|
@@ -33,7 +34,7 @@ function _processCache() {
|
|
|
33
34
|
return reader.read().then(function(param2) {
|
|
34
35
|
var done = param2.done, value = param2.value;
|
|
35
36
|
if (done) {
|
|
36
|
-
var match = ZERO_RENDER_LEVEL.test(html);
|
|
37
|
+
var match = ZERO_RENDER_LEVEL.test(html) || NO_SSR_CACHE.test(html);
|
|
37
38
|
if (match) {
|
|
38
39
|
writer.close();
|
|
39
40
|
return;
|
|
@@ -2,6 +2,7 @@ import { createMemoryStorage } from "@modern-js/runtime-utils/storer";
|
|
|
2
2
|
import { X_RENDER_CACHE } from "../../constants";
|
|
3
3
|
import { createTransformStream, getPathname } from "../../utils";
|
|
4
4
|
const ZERO_RENDER_LEVEL = /"renderLevel":0/;
|
|
5
|
+
const NO_SSR_CACHE = /<meta\s+[^>]*name=["']no-ssr-cache["'][^>]*>/i;
|
|
5
6
|
async function processCache({ request, key, requestHandler, requestHandlerOptions, ttl, container, cacheStatus }) {
|
|
6
7
|
const response = await requestHandler(request, requestHandlerOptions);
|
|
7
8
|
const decoder = new TextDecoder();
|
|
@@ -12,7 +13,7 @@ async function processCache({ request, key, requestHandler, requestHandlerOption
|
|
|
12
13
|
let html = "";
|
|
13
14
|
const push = () => reader.read().then(({ done, value }) => {
|
|
14
15
|
if (done) {
|
|
15
|
-
const match = ZERO_RENDER_LEVEL.test(html);
|
|
16
|
+
const match = ZERO_RENDER_LEVEL.test(html) || NO_SSR_CACHE.test(html);
|
|
16
17
|
if (match) {
|
|
17
18
|
writer.close();
|
|
18
19
|
return;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.60.
|
|
18
|
+
"version": "2.60.3",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"flatted": "^3.2.9",
|
|
54
54
|
"hono": "^3.12.2",
|
|
55
55
|
"ts-deepmerge": "7.0.0",
|
|
56
|
-
"@modern-js/plugin": "2.60.
|
|
57
|
-
"@modern-js/utils": "2.60.
|
|
58
|
-
"@modern-js/
|
|
56
|
+
"@modern-js/plugin": "2.60.3",
|
|
57
|
+
"@modern-js/runtime-utils": "2.60.3",
|
|
58
|
+
"@modern-js/utils": "2.60.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/jest": "^29",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"jest": "^29",
|
|
66
66
|
"ts-jest": "^29.1.0",
|
|
67
67
|
"typescript": "^5",
|
|
68
|
-
"@modern-js/types": "2.60.
|
|
69
|
-
"@scripts/
|
|
70
|
-
"@scripts/
|
|
68
|
+
"@modern-js/types": "2.60.3",
|
|
69
|
+
"@scripts/jest-config": "2.60.3",
|
|
70
|
+
"@scripts/build": "2.60.3"
|
|
71
71
|
},
|
|
72
72
|
"sideEffects": false,
|
|
73
73
|
"publishConfig": {
|