← Notes

The edge is the new origin

Why generative-AI products belong at the edge — and what changes when inference, state, and delivery all live a few milliseconds from the user.

For most of the last decade, “the edge” meant caching. You rendered somewhere central, then pushed bytes outward. That model breaks the moment your product thinks on every request.

Generative commerce is exactly that kind of product. A shopping assistant has to retrieve, reason, and respond inside the few hundred milliseconds a shopper will tolerate — across a dozen languages, at peak traffic, without a cold start ruining the first impression.

Move the computation, not just the cache

The shift is to treat compute as ambient. Code runs near the user by default; state lives in primitives that were built for that topology rather than bolted on.

export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    if (url.pathname.startsWith('/api/')) {
      return handleAssistant(request, env);
    }
    return env.ASSETS.fetch(request);
  },
};

It looks unremarkable. That’s the point — the interesting work is in where this executes, not how it reads.

What actually gets harder

Three things: consistency, observability, and the temptation to over-engineer. The honest answer to most of it is to pick boring, strongly-consistent primitives for the few places that need them, and let everything else be stateless and cheap.

More soon.