Latest Results
Parse each request URL once by caching it on the request
Adapters need a request's URL before handing the request to `match()`
and `render()`, and each step parsed the same string over again: a
typical SSR request parsed `request.url` three or four times.
Add `getRequestURL()`, which parses `request.url` on first use and keeps
the result on the request behind a symbol, the same way render options
already travel with a request. Export it from `astro/app` so adapters,
including community ones, can share the parse instead of each opening
with `new URL(request.url)`.
This replaces the pre-parsed `URL` that an earlier revision threaded
through `RenderOptions` and `match()`. That contract asked callers to
pass a URL equal to `new URL(request.url)` and not to reuse it
afterwards, and nothing enforced either half. A URL derived from
`request.url` on demand cannot disagree with it, since `request.url` is
immutable and a rewritten request is a different object. It also needs
no signature changes, so `createRequestFromNodeRequest` keeps returning
a `Request` and simply hands over the URL it already parsed.
FetchState deliberately keeps parsing its own URL: it rewrites
`url.pathname`, and `state.url` is handed to user code as `Astro.url`.
Cloning the shared URL instead is not an option, because constructing a
URL from another URL serializes and re-parses it, and so costs more than
parsing `request.url` again.
Node needs no adapter change; it benefits from the seeding above.
Netlify's SSR function never parsed a URL of its own, so only its cache
provider changes.iseraph-dev:perf/request-url-cache Latest Branches
0%
iseraph-dev:perf/normalize-url-guard 0%
iseraph-dev:perf/request-url-cache 0%
iseraph-dev:perf/dedupe-route-deserialization © 2026 CodSpeed Technology