When using the Astro Adapter, you must use Astro’s Server Endpoints, not Functions
When using the Astro Adapter, you must use Astro’s Server Endpoints, not Functions
total timing from the Worker is 284 ms while Waiting for server response from the DevTools is at 885 ms—more than 3 times slower.total:
Fetch started eventTimestamp onRequest start onRequest end Fetch finished = simply eventTimestamp
Worker execution = onRequest start - onRequest end
Cloudflare -> Client = Fetch finished - onRequest end
You can see that the most amount of time is actually spent on the way from the worker to the client.
There could be a mistake where the measured Worker end time is not correct since the Date.now` only advances on I/O in workerd. I'll test this a bit later.


functions/users/friends/index.ts will serve a request to /users/daniel/friends, in theory displaying a list of all the friends of daniel, but Im just getting the root app page instead of function output. Do I need to just use a [[catchall]].ts file at functions/users/[[catchall]].ts and handle all of the logic there, or am I doing something wrong?functions/users/index.ts file is working properly, and so is my functions/users/[user].ts file- index displays a list of users, and [user] displays the individual user matching the route param.performance.now() when in reality it wasn't related to it but actually happened beforebcrypt won't work anyway because it uses node-gyp and links to OpenSSL and Workers don't support native Node modules (ones that link to C++).

totaltotalWaiting for server responseFetch startedeventTimestamponRequest startonRequest endFetch finished = simply
= = - -
You can see that the most amount of time is actually spent on the way from the worker to the client.
There could be a mistake where the measured Worker end time is not correct since the functions/users/friends/index.ts/users/daniel/friendsfunctions/users/[[catchall]].tsfunctions/users/index.tsfunctions/users/[user].tsperformance.now()bcryptexport async function onRequest(
context: EventContext<unknown, string, unknown>,
) {
const start = performance.now()
const response = await createPagesFunctionHandler({ build, getLoadContext })(
context,
)
const end = performance.now()
response.headers.append("Server-Timing", `total;dur=${end - start}`)
return response
}export async function onRequest(
context: EventContext<unknown, string, unknown>,
) {
console.log("onRequest start", new Date().toISOString())
const response = await createPagesFunctionHandler({ build, getLoadContext })(
context,
)
await fetch("https://httpbin.org/get")
console.log("onRequest end", new Date().toISOString())
return response
}