---
title: "Edge Workers overview"
description: "How serverless JavaScript and Rust WebAssembly run inside CDN request handling, with an isolated runtime and microsecond cold starts, and what adult platforms use them for."
url: "https://adultinfra.com/docs/edge-workers/overview/"
dateModified: "2026-09-12"
---

[Home](https://adultinfra.com/) / [Docs](https://adultinfra.com/docs/) / Edge Workers 

# Edge Workers overview

How serverless JavaScript and Rust WebAssembly run inside CDN request handling, with an isolated runtime and microsecond cold starts, and what adult platforms use them for.

LAST REVIEWED 2026-09-13

ON THIS PAGE

- [Where workers sit in the request path](https://adultinfra.com/docs/edge-workers/overview/#where-workers-sit-in-the-request-path)
- [Isolated runtime and cold starts](https://adultinfra.com/docs/edge-workers/overview/#isolated-runtime-and-cold-starts)
- [Language and build model](https://adultinfra.com/docs/edge-workers/overview/#language-and-build-model)
- [Integration with CDN features](https://adultinfra.com/docs/edge-workers/overview/#integration-with-cdn-features)
- [What workers are not](https://adultinfra.com/docs/edge-workers/overview/#what-workers-are-not)
- [Adult-platform use cases at a glance](https://adultinfra.com/docs/edge-workers/overview/#adult-platform-use-cases-at-a-glance)
- [Where AdultInfra fits](https://adultinfra.com/docs/edge-workers/overview/#where-adultinfra-fits) 

**Edge Workers** are small programs (JavaScript or Rust compiled to WebAssembly) that run at the edge inside the same request path that serves your CDN traffic. Instead of routing a request to an origin or a central function platform, the edge evaluates your code between the viewer and the cache, then decides what to serve, rewrite, block, or fetch. The workload is serverless: there is no host to patch, and capacity scales with request rate.

This page covers the execution model and where it sits relative to the delivery model described in the [CDN overview](https://adultinfra.com/docs/cdn/cdn-overview/).

## Where workers sit in the request path

A normal CDN request is: viewer → edge cache → origin on a miss. A worker adds programmable points at that path without giving up the cache. Typical insertion points:

- **On request**, before the cache is consulted, so you can rewrite the path, normalise headers, or reject a request early.

- **On cache miss**, before the origin fetch, so you can alter the upstream request or serve a fallback.

- **On response**, after the cache, so you can add or strip headers and shape the response per viewer.

Because workers run per request and per edge location, they see traffic close to the viewer. That is the point: decisions that would otherwise need a round trip to a central service (a token check, a geo rule, a header fix) happen within the same edge hop.

## Isolated runtime and cold starts

Each worker runs in an isolated sandbox with its own memory, no shared filesystem, and no ambient network access beyond the bindings and APIs you explicitly grant. WebAssembly gives the runtime a defined, capability-based boundary: a worker cannot read another worker’s state or reach a resource it was not configured to reach.

Startup is measured in **microseconds to low milliseconds**, not the hundreds of milliseconds typical of container cold starts. That matters for adult traffic patterns, which are bursty and geographically scattered: a promotion, a new release, or a live event can spike one region while others stay quiet. A runtime that instantiates per request absorbs that without a warm-up pool.

## Language and build model

You can write workers in JavaScript or Rust. Rust compiled to WebAssembly suits CPU-bound work such as signing, hashing, or parsing; JavaScript suits request shaping and glue logic. The build produces a portable module that the platform distributes to every edge location. Keep modules small. Instantiation cost and memory limits both favour lean code.

## Integration with CDN features

Workers are not a separate delivery tier. They compose with the resource settings that already exist:

- **Cache keys and cache control.** A worker can influence what is cacheable and how it is keyed, which is where many adult-site cache problems start. See [Cache control and cache keys](https://adultinfra.com/docs/cdn/cache-control/).

- **Access policy.** Workers enforce or refine the access rules described in [Edge access policy](https://adultinfra.com/docs/security/access-policy/).

- **Security.** Workers can run lightweight bot or abuse checks inline, complementing the policies in [Web application and API protection](https://adultinfra.com/docs/security/waf/).

- **Origin protection.** Workers can add signed headers on origin fetches so a private origin only trusts edge traffic.

## What workers are not

Workers are not a general-purpose application host. They are stateless request logic with tight time, memory, and CPU budgets. They are not a database, not a media processor, and not a place to run long-lived jobs. State that must outlive a request belongs in edge KV, cache, or your own origin. See [Edge Workers runtime and storage](https://adultinfra.com/docs/edge-workers/runtime-and-storage/) for the constraints.

## Adult-platform use cases at a glance

The highest-value uses on adult platforms tend to be small, deterministic, and close to the request: entitlement and token validation, geo and policy decisions, request normalisation, hotlink protection, redirects, experiment bucketing, and light personalisation. Each is covered with mechanics in [Edge Workers use cases](https://adultinfra.com/docs/edge-workers/use-cases/).

## Where AdultInfra fits

AdultInfra designs worker logic that respects the runtime’s limits and keeps media on the cache path. Age verification, consent, likeness rights, and moderation decisions remain your responsibility; the edge enforces the policy you define. To scope a worker against a real traffic class, start with [Platform](https://adultinfra.com/platform/) or [contact us](https://adultinfra.com/contact/).

**Need this configured for your platform?** [Get a test plan](https://adultinfra.com/contact/) and an engineer will map the resource, cache, and delivery design to your workload.

```json
{"@context":"https://schema.org","@graph":[{"@type":"TechArticle","headline":"Edge Workers overview","description":"How serverless JavaScript and Rust WebAssembly run inside CDN request handling, with an isolated runtime and microsecond cold starts, and what adult platforms use them for.","url":"https://adultinfra.com/docs/edge-workers/overview/","dateModified":"2026-09-13","keywords":"edge workers, serverless edge compute, WebAssembly edge, adult CDN edge logic, edge functions","author":{"@id":"https://adultinfra.com/#organization"},"publisher":{"@id":"https://adultinfra.com/#organization"},"inLanguage":"en"},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://adultinfra.com/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https://adultinfra.com/docs/"},{"@type":"ListItem","position":3,"name":"Edge Workers overview","item":"https://adultinfra.com/docs/edge-workers/overview/"}]}]}
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://adultinfra.com/#organization","name":"AdultInfra","url":"https://adultinfra.com","logo":"https://adultinfra.com/favicon.svg","description":"Luxembourg-based specialist infrastructure for adult platforms.","slogan":"Already behind the adult internet.","areaServed":"Worldwide","knowsAbout":["Adult video CDN","Porn tube site infrastructure","Adult live-cam streaming","Creator subscription platforms","Byte-range video caching","Origin shielding","Player quality of experience","DDoS protection","GPU infrastructure","Adult-capable AI inference"],"location":{"@type":"Place","name":"Luxembourg","address":{"@type":"PostalAddress","addressCountry":"LU"}},"contactPoint":{"@type":"ContactPoint","contactType":"sales","url":"https://adultinfra.com/contact/"}},{"@type":"WebPage","@id":"https://adultinfra.com/docs/edge-workers/overview/#webpage","url":"https://adultinfra.com/docs/edge-workers/overview/","name":"Edge Workers overview","description":"How serverless JavaScript and Rust WebAssembly run inside CDN request handling, with an isolated runtime and microsecond cold starts, and what adult platforms use them for.","isPartOf":{"@id":"https://adultinfra.com/#website"},"about":{"@id":"https://adultinfra.com/#organization"},"primaryImageOfPage":{"@type":"ImageObject","url":"https://adultinfra.com/og-default.png"},"inLanguage":"en","mainEntity":{"@id":"https://adultinfra.com/docs/edge-workers/overview/#article"},"dateModified":"2026-09-13"},{"@type":"WebSite","@id":"https://adultinfra.com/#website","url":"https://adultinfra.com","name":"AdultInfra","description":"Luxembourg-based specialist infrastructure for adult platforms.","publisher":{"@id":"https://adultinfra.com/#organization"},"inLanguage":"en","potentialAction":{"@type":"ContactAction","target":"https://adultinfra.com/contact/"}}]}
```
