---
title: "Edge Workers use cases"
description: "Concrete edge-worker patterns for adult platforms: token validation, geo and policy decisions, request normalisation, hotlink protection, redirects, experiments, and idempotency under shielding."
url: "https://adultinfra.com/docs/edge-workers/use-cases/"
dateModified: "2026-09-12"
---

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

# Edge Workers use cases

Concrete edge-worker patterns for adult platforms: token validation, geo and policy decisions, request normalisation, hotlink protection, redirects, experiments, and idempotency under shielding.

LAST REVIEWED 2026-09-13

ON THIS PAGE

- [Token validation and entitlement](https://adultinfra.com/docs/edge-workers/use-cases/#token-validation-and-entitlement)
- [Geo and policy decisions](https://adultinfra.com/docs/edge-workers/use-cases/#geo-and-policy-decisions)
- [Request normalisation](https://adultinfra.com/docs/edge-workers/use-cases/#request-normalisation)
- [Hotlink protection](https://adultinfra.com/docs/edge-workers/use-cases/#hotlink-protection)
- [Redirects and routing](https://adultinfra.com/docs/edge-workers/use-cases/#redirects-and-routing)
- [Experiments and lightweight personalisation](https://adultinfra.com/docs/edge-workers/use-cases/#experiments-and-lightweight-personalisation)
- [Idempotency under shielding and retries](https://adultinfra.com/docs/edge-workers/use-cases/#idempotency-under-shielding-and-retries)
- [Choosing where to run](https://adultinfra.com/docs/edge-workers/use-cases/#choosing-where-to-run)
- [Where AdultInfra fits](https://adultinfra.com/docs/edge-workers/use-cases/#where-adultinfra-fits) 

Edge workers earn their place when a decision is small, deterministic, and needed on every request, or when a central round trip would add latency the viewer can feel. The patterns below are the ones that pay off most on high-scale adult platforms. Read [Edge Workers overview](https://adultinfra.com/docs/edge-workers/overview/) first for the execution model.

## Token validation and entitlement

Signed-URL and token checks are the canonical edge job. The worker parses the token, verifies the signature, checks expiry and scope, and either lets the request continue to cache or rejects it with `403`. Keep the secret material in the runtime’s secret store, never in the worker bundle, and keep the check constant-time where the signature scheme allows it.

The design rule that matters for media: **validate entitlement without polluting the cache key.** If a per-viewer token becomes part of the cache key, every viewer is a miss and the cache becomes a pass-through. Validate the token at the edge, then derive the cache key only from fields that genuinely identify the object. See [Cache control and cache keys](https://adultinfra.com/docs/cdn/cache-control/).

## Geo and policy decisions

Workers can branch on the viewer’s coarse geography, ASN, or network attributes before the request reaches the cache or origin. Use this for geo licensing windows, regional content restrictions, and jurisdiction-specific routing. Keep the decision table in edge KV or a small config object so you can change it without redeploying the worker. Age, consent, and lawful-availability rules remain your responsibility to define; the edge enforces what you specify.

## Request normalisation

Origins break in predictable ways when they receive inconsistent input. A worker can canonicalise the path, collapse duplicate query parameters, sort the remaining ones, strip analytics and session noise, and fix `Accept-Encoding` or range headers. Normalisation is often the single highest-impact cache fix: it makes requests that should be identical actually identical, raising hit ratio without changing content.

## Hotlink protection

A worker can inspect `Referer` and other request signals and reject or redirect requests that embed your media from an unauthorised page. Treat this as deterrence, not a wall: `Referer` is spoofable, so pair it with signed URLs and token expiry for anything that costs you real egress. The economics and the limits are covered in [Bot management and scraping](https://adultinfra.com/docs/security/bot-management/).

## Redirects and routing

Path rewrites, locale redirects, maintenance routing, and legacy-URL mapping all belong at the edge. A worker can redirect before the cache is consulted, which avoids caching a redirect for the wrong audience and avoids an origin hit for a URL you already know is obsolete. Return the right status (`301`/`308` for permanent, `302`/`307` for temporary) and be deliberate about preserving the method.

## Experiments and lightweight personalisation

Workers can bucket a viewer deterministically from a stable input (a cookie, a hashed identifier, or a query parameter) and serve variant A or B. For media, the safe pattern is to vary the **manifest or metadata**, not the bytes, so the cache stays shared. Lightweight personalisation (a thumbnail order, a locale string, a badge) fits well; anything requiring a per-viewer database read usually belongs behind the cache, not in front of it.

## Idempotency under shielding and retries

When you enable [origin shielding and failover](https://adultinfra.com/docs/cdn/origin-shielding/), a worker may execute more than once for what the viewer experiences as one request: a shielded fill can retry, and a client can retry a timed-out request. Make side effects idempotent. If a worker writes a counter, records an event, or triggers a purge, key the operation on a deterministic request identifier so a retry does not double-count. Read-modify-write against shared state is the classic failure: two concurrent fills can lose an increment. Prefer append-only events and let a downstream system aggregate.

## Choosing where to run

Pattern Runs on request Touches cache key Needs shared state Token validation Yes No Secret only Geo/policy branch Yes Sometimes Config in KV Normalisation Yes Yes (deliberately) No Hotlink rejection Yes No No Redirect Yes No No A/B bucketing Yes No No Event logging Yes No Append-only 

## Where AdultInfra fits

AdultInfra writes worker logic that stays inside the runtime budget and keeps the cache working, rather than turning the edge into a per-request origin proxy. Start from [Edge Workers runtime and storage](https://adultinfra.com/docs/edge-workers/runtime-and-storage/) to understand the limits, or [contact us](https://adultinfra.com/contact/) with the request path you want to change.

**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 use cases","description":"Concrete edge-worker patterns for adult platforms: token validation, geo and policy decisions, request normalisation, hotlink protection, redirects, experiments, and idempotency under shielding.","url":"https://adultinfra.com/docs/edge-workers/use-cases/","dateModified":"2026-09-13","keywords":"edge worker use cases, token validation at edge, hotlink protection, edge redirects, edge A/B testing","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 use cases","item":"https://adultinfra.com/docs/edge-workers/use-cases/"}]}]}
{"@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/use-cases/#webpage","url":"https://adultinfra.com/docs/edge-workers/use-cases/","name":"Edge Workers use cases","description":"Concrete edge-worker patterns for adult platforms: token validation, geo and policy decisions, request normalisation, hotlink protection, redirects, experiments, and idempotency under shielding.","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/use-cases/#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/"}}]}
```
