@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.
@@ -191,11 +191,12 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
191
191
  headers.set("content-type", HTML_CONTENT_TYPE);
192
192
  headers.set(STREAMING_PAGE_HEADER, "1");
193
193
  return headers;
194
- }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request) => {
194
+ }, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
195
195
  const contentType = response.headers.get("content-type") ?? "";
196
196
  if (!contentType.includes(HTML_CONTENT_TYPE))
197
197
  return response;
198
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
198
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
199
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
199
200
  response.headers.delete(STREAMING_PAGE_HEADER);
200
201
  response.headers.set("cache-control", "no-cache");
201
202
  return response;
@@ -209,6 +210,7 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
209
210
  });
210
211
  }
211
212
  const headers = new Headers(response.headers);
213
+ headers.delete(STREAMING_PAGE_HEADER);
212
214
  headers.set("cache-control", "no-cache");
213
215
  headers.set("etag", etag);
214
216
  return new Response(html, {
@@ -4119,7 +4121,9 @@ var handleReactPageRequest = async (input) => {
4119
4121
  });
4120
4122
  };
4121
4123
  const pageResponse = await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
4122
- return withPageCacheHeaders(pageResponse, input.request);
4124
+ return withPageCacheHeaders(pageResponse, input.request, {
4125
+ bufferStreamForEtag: input.bufferStreamForEtag
4126
+ });
4123
4127
  } catch (error) {
4124
4128
  console.error("[SSR] React render error:", error);
4125
4129
  const conventionResponse = await renderConventionError("react", pageName, error);
@@ -4296,5 +4300,5 @@ export {
4296
4300
  Island
4297
4301
  };
4298
4302
 
4299
- //# debugId=F2CC8AF56565368C64756E2164756E21
4303
+ //# debugId=A6426AEA34F17C4964756E2164756E21
4300
4304
  //# sourceMappingURL=index.js.map