Home/Blog/OpenForge 3.2: Edge Functions & Middleware Rewrite
ReleaseMar 12, 2026·5 min read

OpenForge 3.2: Edge Functions & Middleware Rewrite

SC

Sarah Chen

Core Maintainer

We're thrilled to announce OpenForge 3.2, our most performance-focused release to date. This update rewrites the middleware engine from the ground up to be edge-compatible, slashes cold start times in half, and introduces first-class WebSocket support.

The new middleware engine runs on the edge by default. This means your auth checks, rate limiters, and request transformations execute at the network edge — closest to your users. We measured a 3x improvement in time-to-first-byte for middleware-heavy applications.

Cold starts have been a pain point for serverless deployments. In 3.2, we reduced the runtime initialization footprint by 50% through lazy module loading and tree-shaking the core runtime. A fresh OpenForge function now boots in under 50ms on AWS Lambda.

WebSocket support was the most requested feature on our GitHub Discussions. You can now export a SOCKET handler from any route file to handle persistent connections. The API feels natural — it follows the same patterns you already know from HTTP handlers.

// src/routes/chat.ts — WebSocket route
import type { SocketHandler } from "@openforge/core";

export const SOCKET: SocketHandler = {
  open(ws) {
    ws.subscribe("chat-room");
    ws.send(JSON.stringify({ type: "welcome" }));
  },

  message(ws, message) {
    ws.publish("chat-room", message);
  },

  close(ws) {
    ws.unsubscribe("chat-room");
  },
};