netlify-edge-functions

Write Netlify Edge Functions for middleware, geolocation, and request manipulation on Deno.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-edge-functions-jamesmitofsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-edge-functions
Source: https://github.com/JamesMitofsky/tag-archive/tree/main/.claude/skills/netlify-edge-functions
Command: npx skills add https://github.com/JamesMitofsky/tag-archive --skill netlify-edge-functions-jamesmitofsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/edge-functions.

What problem does it solve? Writing Netlify Edge Functions involves platform-specific pitfalls: functions that deploy but never run, cache headers that silently do nothing, and edge functions that intercept every static asset. This Skill provides the correct patterns for the Deno-based edge runtime so your middleware, redirects, and personalization logic work as intended. ## Core Features & Use Cases - Middleware Pattern: Use context.next() to short-circuit requests (e.g., auth checks returning 401) or modify responses after the origin responds. - Geolocation & Cookies: Read context.geo for country-based redirects and manage cookies via context.cookies instead of hand-parsing headers. - Configuration Guidance: Bind functions to paths via inline config or netlify.toml, control chaining order, and avoid common traps like path: "/*" matching static assets. - Use Case: Build an authentication gate on /admin/* that runs before a personalization rewrite, declared in netlify.toml to guarantee execution order. ## Quick Start Write a Netlify edge function that redirects German visitors to /de using geolocation.

Frequently Asked Questions about netlify-edge-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Netlify Edge Function?

Create a TypeScript or JavaScript file in netlify/edge-functions/ that exports a default handler receiving a Request and Context, plus a config export with a path pattern. The function runs on Netlify's Deno-based edge network close to users.

When should I use edge functions vs serverless functions?

Use edge functions for low-latency work like geolocation, auth checks, redirects, and A/B testing. Use serverless functions for long-running operations up to 15 minutes, heavy Node.js dependencies, database-heavy work, or tasks needing over 512 MB memory.

Why is my Netlify edge function not running?

A file in netlify/edge-functions/ with no path binding deploys but never runs, with no build error or warning. Confirm it declares a path inline via export const config or has a matching [[edge_functions]] entry in netlify.toml.

Why are my Cache-Control headers ignored on edge function responses?

Cache headers on an edge function response have no effect unless the function opts in with cache: "manual" in its config. Without that flag the response is never cached regardless of headers set.

How do I control the order of multiple edge functions on one path?

Functions declared in netlify.toml run first in file order, then inline-config functions run alphabetically by filename, and caching functions run last. Declare functions in netlify.toml in your desired order to guarantee deterministic execution.

What are the limits of Netlify Edge Functions?

Edge functions are limited to 50 ms CPU time per request, 512 MB memory per deployed set, a 40-second response header timeout, and 20 MB compressed code size. Workloads exceeding these belong in serverless functions.