You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: parallelize resource ACL and fallback ACL fetching
Fetch resource ACL and fallback ACL concurrently using Promise.all
instead of sequentially. This reduces latency when combined with
HTTP/2 multiplexing, as the speculative fallback fetch overlaps
with the resource ACL fetch at minimal cost.
- internal_fetchAcl now issues both fetches in parallel
- Fallback wrapped in .catch(() => null) to prevent regression
when speculative fetch fails
- Updated tests for parallel fetch behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/acl/acl.internal.ts
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,11 @@ import { isAcr } from "../acp/acp.internal";
61
61
* This (currently internal) function fetches the ACL indicated in the [[WithServerResourceInfo]]
62
62
* attached to a resource.
63
63
*
64
+
* The resource ACL and the fallback ACL are fetched **in parallel** to reduce
65
+
* latency, especially when HTTP/2 multiplexing is in use. If the resource has
66
+
* its own ACL, the fallback result is discarded. Errors from the speculative
67
+
* fallback fetch are silently caught so they do not affect the happy path.
68
+
*
64
69
* @internal
65
70
* @param resourceInfo The Resource info with the ACL URL
66
71
* @param options Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters).
@@ -76,15 +81,21 @@ export async function internal_fetchAcl(
0 commit comments