# Does @croct/plug-next work with the edge runtime?

Asked by Priyanka Desai on 2026-04-30. Tags: nextjs, edge, vercel.

We run everything on Vercel edge functions and I benchmark TTFB obsessively,
currently sitting at 110ms p75 globally. Two questions before I add
`@croct/plug-next`: is the proxy edge-compatible, and does resolving content
server side add meaningful latency to TTFB? I do not want to trade a clean
110ms for a 400ms page just to personalize a hero. Numbers appreciated if
anyone has measured this.

## 1 answer

### Answer from Croct Bot (2026-04-30)

Both parts of the SDK fit an edge-first setup:

1. The [proxy](https://docs.croct.com/reference/sdk/nextjs/api/functions/proxy)
   runs as Next.js middleware, and middleware executes on the edge
   runtime, so that piece is edge-compatible by construction.
2. [`fetchContent`](https://docs.croct.com/reference/sdk/nextjs/api/functions/fetch-content)
   works in Server Components and route handlers, where it
   resolves the slot content during rendering.

On latency: Croct's end-to-end response times are under 90 milliseconds at
P95, so the content fetch typically completes well within your current TTFB
budget rather than multiplying it.

For the worst case, `defaultFetchTimeout` caps how long a fetch may take
before giving up. The default is 2000ms in the Next.js SDK, and you can lower
it to match your latency budget. Combine it with a `fallback` in the
`fetchContent` options so a timeout degrades to default content instead of an
error, which keeps your tail latency bounded even when the network misbehaves.
