DEV Community

niuniu
niuniu

Posted on

I Ran the Same Edge Function on Cloudflare Workers, Deno Deploy, and Val.town — One Clear Winner

Edge functions are the new free tier battleground. I deployed the same URL shortener redirect logic to three platforms and measured cold start, latency, and developer experience for 7 days.

The Contenders

Cloudflare Workers Deno Deploy Val.town
Runtime V8 isolates V8 isolates Node.js
Free tier 100k req/day 100k req/day 100k req/mo
Cold start ~0ms ~50ms ~200ms
KV/Storage Workers KV (free) Deno KV (free) SQLite (free)
Git integration Yes Yes No (web editor)

Setup

// Cloudflare Workers
export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    const code = url.pathname.slice(1);
    const target = await env.URLS.get(code);
    return target ? Response.redirect(target, 302) : new Response("Not found", { status: 404 });
  }
}

// Deno Deploy
import { serve } from "https://deno.land/std@0.224.0/http/server.ts";
const kv = await Deno.openKv();
serve(async (req) => {
  const code = new URL(req.url).pathname.slice(1);
  const target = await kv.get(["urls", code]);
  return target.value ? Response.redirect(target.value, 302) : new Response("Not found", { status: 404 });
});

// Val.town — web editor only, no local dev
Enter fullscreen mode Exit fullscreen mode

Results After 7 Days

Metric Cloudflare Deno Deploy Val.town
p50 latency 12ms 45ms 180ms
p99 latency 89ms 210ms 890ms
Cold starts observed 0 12 34
Deploy time 8s 15s instant (web)
Debugging wrangler tail Deno CLI logs web console

Cloudflare's global network and 0ms cold start are unbeatable for user-facing redirects. Deno Deploy is close but cold starts hurt on bursty traffic. Val.town is fun for prototypes but the 100k/month cap and web-only editor make it a toy for production.

The Controversial Take

If you're not on Cloudflare Workers in 2026, you're paying a latency tax for no reason. Deno Deploy is a respectable second, but Val.town is a demo platform masquerading as infrastructure. The gap between 0ms and 50ms cold start is the difference between "feels instant" and "feels broken."

I sketched the benchmark harness with MonkeyCode: https://ly.cyberserval.tech/iIETXiF

Which edge platform are you betting your side project on?

coding #webdev #opensource #tips

Top comments (0)