@absolutejs/absolute 0.19.0-beta.1074 → 0.19.0-beta.1075

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.
@@ -211,11 +211,12 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
211
211
  headers.set("content-type", HTML_CONTENT_TYPE);
212
212
  headers.set(STREAMING_PAGE_HEADER, "1");
213
213
  return headers;
214
- }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request) => {
214
+ }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
215
215
  const contentType = response.headers.get("content-type") ?? "";
216
216
  if (!contentType.includes(HTML_CONTENT_TYPE))
217
217
  return response;
218
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
218
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
219
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
219
220
  response.headers.delete(STREAMING_PAGE_HEADER);
220
221
  response.headers.set("cache-control", "no-cache");
221
222
  return response;
@@ -229,6 +230,7 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
229
230
  });
230
231
  }
231
232
  const headers = new Headers(response.headers);
233
+ headers.delete(STREAMING_PAGE_HEADER);
232
234
  headers.set("cache-control", "no-cache");
233
235
  headers.set("etag", etag);
234
236
  return new Response(html, {
@@ -2268,7 +2270,9 @@ var handleVuePageRequest = async (input) => {
2268
2270
  });
2269
2271
  };
2270
2272
  const pageResponse = await runWithStreamingSlotWarningScope(() => resolvedOptions?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, resolvedOptions) : renderPageResponse(), { handlerCallsite });
2271
- return withPageCacheHeaders(pageResponse, input.request);
2273
+ return withPageCacheHeaders(pageResponse, input.request, {
2274
+ bufferStreamForEtag: input.bufferStreamForEtag
2275
+ });
2272
2276
  } catch (error) {
2273
2277
  console.error("[SSR] Vue render error:", error);
2274
2278
  const pageName = derivePageName(resolvedPagePath);
@@ -2304,5 +2308,5 @@ export {
2304
2308
  applyVueRouterRedirect
2305
2309
  };
2306
2310
 
2307
- //# debugId=8E3E2F75CCC3FBB264756E2164756E21
2311
+ //# debugId=640AF13916F4E0C664756E2164756E21
2308
2312
  //# sourceMappingURL=server.js.map