@netlify/plugin-nextjs 5.15.3 → 5.15.5
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.
|
@@ -322,7 +322,9 @@ var copyPrerenderedContent = async (ctx) => {
|
|
|
322
322
|
const key = routeToFilePath(route);
|
|
323
323
|
const value = await buildAppCacheValue(
|
|
324
324
|
join(ctx.publishDir, "server/app", key),
|
|
325
|
-
shouldUseAppPageKind
|
|
325
|
+
shouldUseAppPageKind,
|
|
326
|
+
// shells always have `renderingMode === 'PARTIALLY_STATIC'`
|
|
327
|
+
false
|
|
326
328
|
);
|
|
327
329
|
await writeCacheEntry(key, value, Date.now(), ctx);
|
|
328
330
|
})
|
|
@@ -86,7 +86,7 @@ var pipeline = (0, import_util.promisify)(import_stream.pipeline);
|
|
|
86
86
|
|
|
87
87
|
// package.json
|
|
88
88
|
var name = "@netlify/plugin-nextjs";
|
|
89
|
-
var version = "5.15.
|
|
89
|
+
var version = "5.15.5";
|
|
90
90
|
|
|
91
91
|
// src/run/handlers/tags-handler.cts
|
|
92
92
|
var import_storage = require("../storage/storage.cjs");
|
package/dist/run/headers.js
CHANGED
|
@@ -148,7 +148,7 @@ function setCacheControlFromRequestContext(headers, revalidate) {
|
|
|
148
148
|
headers.set("netlify-cdn-cache-control", cdnCacheControl);
|
|
149
149
|
}
|
|
150
150
|
var setCacheControlHeaders = ({ headers, status }, request, requestContext) => {
|
|
151
|
-
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
|
|
151
|
+
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && (headers.has("x-nextjs-cache") || !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control"))) {
|
|
152
152
|
setCacheControlFromRequestContext(headers, requestContext.routeHandlerRevalidate);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
@@ -164,21 +164,23 @@ var setCacheControlHeaders = ({ headers, status }, request, requestContext) => {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
const cacheControl = headers.get("cache-control");
|
|
167
|
-
if (cacheControl !== null && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
|
|
167
|
+
if (cacheControl !== null && ["GET", "HEAD"].includes(request.method) && (headers.has("x-nextjs-cache") || !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control"))) {
|
|
168
168
|
const browserCacheControl = omitHeaderValues(cacheControl, [
|
|
169
169
|
"s-maxage",
|
|
170
170
|
"stale-while-revalidate"
|
|
171
171
|
]);
|
|
172
|
+
const cacheControlForCdnFromNext = headers.get("cdn-cache-control") ?? cacheControl;
|
|
172
173
|
const cdnCacheControl = (
|
|
173
174
|
// if we are serving already stale response, instruct edge to not attempt to cache that response
|
|
174
175
|
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate, durable" : [
|
|
175
|
-
...getHeaderValueArray(
|
|
176
|
+
...getHeaderValueArray(cacheControlForCdnFromNext).map(
|
|
176
177
|
(value) => value === "stale-while-revalidate" ? "stale-while-revalidate=31536000" : value
|
|
177
178
|
),
|
|
178
179
|
"durable"
|
|
179
180
|
].join(", ")
|
|
180
181
|
);
|
|
181
182
|
headers.set("cache-control", browserCacheControl || "public, max-age=0, must-revalidate");
|
|
183
|
+
headers.delete("cdn-cache-control");
|
|
182
184
|
headers.set("netlify-cdn-cache-control", cdnCacheControl);
|
|
183
185
|
return;
|
|
184
186
|
}
|
|
@@ -772,14 +772,14 @@ var Store = class _Store {
|
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
|
-
var getDeployStore = (input = {}) => {
|
|
775
|
+
var getDeployStore = (input = {}, options) => {
|
|
776
776
|
const context = getEnvironmentContext();
|
|
777
|
-
const
|
|
778
|
-
const deployID =
|
|
777
|
+
const mergedOptions = typeof input === "string" ? { ...options, name: input } : input;
|
|
778
|
+
const deployID = mergedOptions.deployID ?? context.deployID;
|
|
779
779
|
if (!deployID) {
|
|
780
780
|
throw new MissingBlobsEnvironmentError(["deployID"]);
|
|
781
781
|
}
|
|
782
|
-
const clientOptions = getClientOptions(
|
|
782
|
+
const clientOptions = getClientOptions(mergedOptions, context);
|
|
783
783
|
if (!clientOptions.region) {
|
|
784
784
|
if (clientOptions.edgeURL || clientOptions.uncachedEdgeURL) {
|
|
785
785
|
if (!context.primaryRegion) {
|
|
@@ -793,7 +793,7 @@ var getDeployStore = (input = {}) => {
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
const client = new Client(clientOptions);
|
|
796
|
-
return new Store({ client, deployID, name:
|
|
796
|
+
return new Store({ client, deployID, name: mergedOptions.name });
|
|
797
797
|
};
|
|
798
798
|
|
|
799
799
|
// src/run/storage/regional-blob-store.cts
|