Infrastructure Layer

Edge Architecture for
Programmable Web Delivery

NinjaWeb5 runs between your origin and the browser — transforming HTML responses in real time, without touching your backend.

Core Concept

A New Layer
in the Web Stack

The web has always had two layers: the server that generates content and the browser that renders it. NinjaWeb5 adds a third — a programmable edge layer that intercepts responses and controls what users actually receive.

This isn't a plugin or a CMS extension. It's infrastructure — operating at the network level, processing every HTTP response before it reaches the browser.

Layer 1 · Origin
Server / CMS / Backend
Generates the original HTML response. Unchanged — NinjaWeb5 never touches your origin code.
Layer 2 · ✦ New
Ninja Edge Layer
Intercepts the response. Applies rules, datasets, and transformations. Returns modified HTML — in real time, at the edge.
Layer 3 · Browser
User / Browser
Receives the transformed response. Sees exactly what the rules define — not what the origin generated.
Control what users actually receive —
not just what servers generate.
Architecture Shift

Before Ninja vs With Ninja

Without Ninja
User Request
Origin Server
HTML Response (fixed)
Browser
No control over output Every user receives the same response the origin generates. Personalization, experimentation, and transformations require backend changes, deployments, and engineering time.
With NinjaWeb5
User Request
✦ Ninja Edge Layer
Origin Server
✦ Ninja Transforms
Browser (modified output)
Full output control Ninja intercepts both the request and the response. Rules, datasets, and transformations are applied at the edge — instantly, without touching origin code.
Request Flow

How Requests Flow Through Ninja

Step 01
User Request

Browser sends an HTTP request for a page.

Step 02
Edge Intercept

Cloudflare Worker intercepts the request before it reaches the origin.

Step 03
Origin Response

Origin server returns the original HTML response — unchanged.

Step 04
Apply Rules

Ninja matches rules, binds datasets, and applies transformations to the HTML stream.

Step 05
Modified Output

The transformed response reaches the browser — personalized, optimized, and controlled.

Execution Model

Execution at the Edge

Ninja runs on Cloudflare's global edge network — physically close to every user. Processing happens before the response travels the last mile, eliminating the latency penalty of server-side personalization.

<5ms
Low latency

Transformations are applied at the edge — milliseconds of overhead, not seconds of server round-trip.

100%
Real-time processing

Every request is processed live. No cache invalidation loops, no stale content — the right output, every time.

0
Origin dependency

Rules execute at the edge. If the origin goes down, edge-cached responses continue to be transformed and delivered.

Killer Feature

No Backend Changes Required

The single most important property of the Ninja architecture: the origin is never touched. No code changes. No deployments. No CMS configuration. Your existing infrastructure stays exactly as it is.

Traditional approach
To personalize content,
you need to:
  • Modify backend code or API endpoints
  • Deploy to staging, then production
  • Update CMS templates or plugins
  • Coordinate frontend and backend teams
  • Wait for release windows
  • Risk breaking existing functionality
  • Write tests and roll out gradually
With NinjaWeb5
Nothing on the origin
changes. Ever.
  • Define a rule in the Ninja dashboard
  • Activate — changes are live in seconds
  • CMS, backend, and code remain untouched
  • No deployment window required
  • No coordination between teams
  • Pause or rollback any rule instantly
  • Zero risk to existing functionality
Predictability

Deterministic Output Control

Same input conditions always produce the same output. Rules are explicit, testable, and version-controlled. There are no hidden side effects, no race conditions, and no "it worked on staging" surprises. This makes Ninja safe for enterprise-grade deployments.

Origin HTML (input) <h1>Welcome to {{city}}</h1>
<p>From {{price}}/mo</p>
<a>{{cta_label}}</a>

+ rule: geo = GB
+ dataset: GB row
Ninja
Edge Engine

deterministic
rule execution

Modified HTML (output) <h1>Welcome to London</h1>
<p>From £29 GBP/mo</p>
<a>Get London pricing</a>

✓ Always the same output
✓ for the same input
Scope of Control

What the Edge Layer Can Control

Anything in the HTTP response is within Ninja's control. Every element of the page that reaches the browser can be intercepted, modified, or replaced — at the edge, before rendering.

📄
HTML Structure

Add, remove, or reorder DOM elements. Inject blocks, hide sections, modify attributes — any structural change without touching source code.

UI Layer →
🏷️
Metadata

Rewrite title tags, meta descriptions, Open Graph tags, and canonical URLs. Full SEO control over every page, in real time.

SEO Layer →
⚙️
Scripts

Inject, block, or reorder third-party and custom scripts. Control execution order and loading strategy without a tag manager.

Security Layer →
🎨
UI & Content

Swap CTAs, change copy, modify styles, inject banners. Deliver personalized interfaces for any segment, instantly.

UI Layer →
📊
Data Bindings

Bind dataset values to template variables. Geo, pricing, language, offer text — any data field rendered into HTML at the edge.

Data Layer →
Ninja is not a tool.
It's an infrastructure layer —
the programmable delivery plane of the web.
Architecture Comparison

Traditional vs Edge Architecture

DimensionTraditional Web ArchitectureNinjaWeb5 Edge Architecture
Where changes happen Backend — requires code changes and deployments Edge — rules applied in real time, no deploys
Who controls output Engineers — every change needs a developer Anyone — product, growth, marketing
Time to ship a change Days to weeks — ticket, review, deploy, verify Seconds — activate the rule
Personalization Requires backend logic, APIs, and CDPs Dataset binding at the edge — no backend
Rollback Another deployment or hotfix required One click — disable or revert the rule
Experimentation Complex setup, dev involvement every test Define variants, set traffic split, launch
Stack dependency Tightly coupled to CMS / framework / backend Works above any stack — CMS-agnostic
Why It Matters

Why This Architecture Matters

Faster iteration

Ship changes in seconds. Test hypotheses daily. No sprint cycle required.

🛡️
Safer changes

Origin is untouched. Every rule can be paused or rolled back instantly, with zero risk.

🎯
More control

Everything in the HTTP response is programmable. The edge is where control lives.

📐
Better scalability

One rule covers all traffic. One dataset powers unlimited personalizations. No per-user backend calls.

Explore the Platform

Built on This Architecture

Rules Engine
Programmable Rules
Define what Ninja does — match conditions, apply transformations, control output logic across any page.
Explore →
Data Layer
Datasets & Variables
Bind structured data to HTML. Geo, pricing, copy, and segment variables — rendered at the edge, from your datasets.
Explore →
QA & Preview
Validate Before Production
Preview any rule output as a dry run — validate transformations against real pages before activating them live.
Explore →

Build on the Edge

A programmable delivery layer between your origin and every user —
activate rules, control output, ship instantly.