Hey everyone! Anybody encountered slow functions response times? Recently finished a migration to C

Hey everyone! Anybody encountered slow functions response times?

Recently finished a migration to CF Pages of one of my Remix apps. The issue is that "Waiting for server response" timing is much slower than the whole duration of the function itself.

The
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.

Here's how I measure
total
:
export 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
}


Can't figure out where's the issue here. Is it the code, or network issues?
CleanShot_2024-09-22_at_00.29.262x.png
Was this page helpful?