@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.
@@ -37373,11 +37373,12 @@ var streamingPageHeaders = (extra) => {
37373
37373
  return headers;
37374
37374
  };
37375
37375
  var computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`;
37376
- var withPageCacheHeaders = async (response, request) => {
37376
+ var withPageCacheHeaders = async (response, request, options) => {
37377
37377
  const contentType = response.headers.get("content-type") ?? "";
37378
37378
  if (!contentType.includes(HTML_CONTENT_TYPE))
37379
37379
  return response;
37380
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
37380
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
37381
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
37381
37382
  response.headers.delete(STREAMING_PAGE_HEADER);
37382
37383
  response.headers.set("cache-control", "no-cache");
37383
37384
  return response;
@@ -37391,6 +37392,7 @@ var withPageCacheHeaders = async (response, request) => {
37391
37392
  });
37392
37393
  }
37393
37394
  const headers = new Headers(response.headers);
37395
+ headers.delete(STREAMING_PAGE_HEADER);
37394
37396
  headers.set("cache-control", "no-cache");
37395
37397
  headers.set("etag", etag);
37396
37398
  return new Response(html, {
@@ -38609,7 +38611,9 @@ var handleReactPageRequest = async (input) => {
38609
38611
  });
38610
38612
  };
38611
38613
  const pageResponse = await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
38612
- return withPageCacheHeaders(pageResponse, input.request);
38614
+ return withPageCacheHeaders(pageResponse, input.request, {
38615
+ bufferStreamForEtag: input.bufferStreamForEtag
38616
+ });
38613
38617
  } catch (error) {
38614
38618
  console.error("[SSR] React render error:", error);
38615
38619
  const conventionResponse = await renderConventionError("react", pageName, error);
package/dist/index.js CHANGED
@@ -8685,11 +8685,12 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
8685
8685
  headers.set("content-type", HTML_CONTENT_TYPE);
8686
8686
  headers.set(STREAMING_PAGE_HEADER, "1");
8687
8687
  return headers;
8688
- }, computeEtag = (html) => `W/"${createHash3("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request) => {
8688
+ }, computeEtag = (html) => `W/"${createHash3("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
8689
8689
  const contentType = response.headers.get("content-type") ?? "";
8690
8690
  if (!contentType.includes(HTML_CONTENT_TYPE))
8691
8691
  return response;
8692
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
8692
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
8693
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
8693
8694
  response.headers.delete(STREAMING_PAGE_HEADER);
8694
8695
  response.headers.set("cache-control", "no-cache");
8695
8696
  return response;
@@ -8703,6 +8704,7 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
8703
8704
  });
8704
8705
  }
8705
8706
  const headers = new Headers(response.headers);
8707
+ headers.delete(STREAMING_PAGE_HEADER);
8706
8708
  headers.set("cache-control", "no-cache");
8707
8709
  headers.set("etag", etag);
8708
8710
  return new Response(html, {
@@ -46711,5 +46713,5 @@ export {
46711
46713
  ANGULAR_INIT_TIMEOUT_MS
46712
46714
  };
46713
46715
 
46714
- //# debugId=2D1E98E62AB63D3064756E2164756E21
46716
+ //# debugId=F6FD2F06153BC10064756E2164756E21
46715
46717
  //# sourceMappingURL=index.js.map