@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.
@@ -1176,11 +1176,12 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
1176
1176
  headers.set("content-type", HTML_CONTENT_TYPE);
1177
1177
  headers.set(STREAMING_PAGE_HEADER, "1");
1178
1178
  return headers;
1179
- }, computeEtag = (html) => `W/"${createHash2("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request) => {
1179
+ }, computeEtag = (html) => `W/"${createHash2("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
1180
1180
  const contentType = response.headers.get("content-type") ?? "";
1181
1181
  if (!contentType.includes(HTML_CONTENT_TYPE))
1182
1182
  return response;
1183
- if (response.headers.get(STREAMING_PAGE_HEADER) === "1" || !response.body) {
1183
+ const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
1184
+ if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
1184
1185
  response.headers.delete(STREAMING_PAGE_HEADER);
1185
1186
  response.headers.set("cache-control", "no-cache");
1186
1187
  return response;
@@ -1194,6 +1195,7 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
1194
1195
  });
1195
1196
  }
1196
1197
  const headers = new Headers(response.headers);
1198
+ headers.delete(STREAMING_PAGE_HEADER);
1197
1199
  headers.set("cache-control", "no-cache");
1198
1200
  headers.set("etag", etag);
1199
1201
  return new Response(html, {
@@ -3016,7 +3018,9 @@ var handleSveltePageRequest = async (input) => {
3016
3018
  ...resolvedOptions,
3017
3019
  runtimePlacement: resolvedOptions.runtimePlacement ?? "body"
3018
3020
  }) : renderPageResponse(), { handlerCallsite });
3019
- return withPageCacheHeaders(pageResponse, input.request);
3021
+ return withPageCacheHeaders(pageResponse, input.request, {
3022
+ bufferStreamForEtag: input.bufferStreamForEtag
3023
+ });
3020
3024
  } catch (error) {
3021
3025
  console.error("[SSR] Svelte render error:", error);
3022
3026
  const pageName = derivePageName(resolvedPagePath);
@@ -3034,5 +3038,5 @@ export {
3034
3038
  handleSveltePageRequest
3035
3039
  };
3036
3040
 
3037
- //# debugId=AA67A6447863E6B964756E2164756E21
3041
+ //# debugId=B672727CA49AF52C64756E2164756E21
3038
3042
  //# sourceMappingURL=server.js.map