@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.
package/dist/build.js CHANGED
@@ -24314,11 +24314,12 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
24314
24314
  headers.set("content-type", HTML_CONTENT_TYPE);
24315
24315
  headers.set(STREAMING_PAGE_HEADER, "1");
24316
24316
  return headers;
24317
- }, computeEtag = (html) => `W/"${createHash4("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request) => {
24317
+ }, computeEtag = (html) => `W/"${createHash4("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
24318
24318
  const contentType = response.headers.get("content-type") ?? "";
24319
24319
  if (!contentType.includes(HTML_CONTENT_TYPE))
24320
24320
  return response;
24321
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
24321
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
24322
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
24322
24323
  response.headers.delete(STREAMING_PAGE_HEADER);
24323
24324
  response.headers.set("cache-control", "no-cache");
24324
24325
  return response;
@@ -24332,6 +24333,7 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
24332
24333
  });
24333
24334
  }
24334
24335
  const headers = new Headers(response.headers);
24336
+ headers.delete(STREAMING_PAGE_HEADER);
24335
24337
  headers.set("cache-control", "no-cache");
24336
24338
  headers.set("etag", etag);
24337
24339
  return new Response(html, {
@@ -27720,5 +27722,5 @@ export {
27720
27722
  build
27721
27723
  };
27722
27724
 
27723
- //# debugId=4FE6957C88C1F03C64756E2164756E21
27725
+ //# debugId=A4432A26575064A564756E2164756E21
27724
27726
  //# sourceMappingURL=build.js.map