Click Below to Get the Code

Browse, clone, and build from real-world templates powered by Harper.
Tutorial
GitHub Logo

Overview of Redirector Component

Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups—no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.
Tutorial

Overview of Redirector Component

By
Stephen Ludin
April 30, 2025
By
Stephen Ludin
April 30, 2025
April 30, 2025
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups—no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.
Stephen Ludin
Chief Architect of Customer Delivery

When your URL map changes, every millisecond spent in a 404 costs rankings, revenue, and trust. The Harper Redirector lets you manage millions of redirects with 1 millisecond P95 lookups—without bolting on a separate database, cache, or edge worker. Below is a quick technical tour so you can clone the repo and start stress‑testing it today.


Why a Dedicated Redirect Engine?

Scale

  • Legacy approach: Apache/Nginx conf files grow linearly and reload slowly.
  • Harper Redirector: Horizontally sharded tables; handling hundreds of millions of rules is routine. 

Latency

  • Legacy approach: Database lookups or client‑side JavaScript add extra round‑trips.
  • Harper Redirector: In‑memory index inside the Harper runtime delivers sub‑millisecond lookups

Ops

  • Legacy Approach: Redirects scattered across YAML files, CDN rules, and spreadsheets.
  • Harper Redirector: One CSV/JSON import or REST write—fully versioned and promotable in bulk. 

Under the Hood

  • Smart matching – Host‑aware lookups, optional regex paths, and query‑string operations (qs:preserve, qs:filter) so one rule can handle thousands of permutations
  • Versioning – Flip activeVersion in the version table to atomically swap an entire redirect set—perfect for re‑platform launches. 

Metrics out of the box – Every hit is written to a metrics stream; drop it into Grafana or the Harper Analytics API for real‑time insight.

3‑Step Local Spin‑Up

Requires the Harper CLI (npm i -g harperdb).

The harperdb dev . command will automatically watch for file changes within the component directory and restart the Harper threads when changes are detected.

Importing Rules

Fields include path, redirectURL, optional utcStartTime/EndTime, and regex flag. JSON is equally accepted.

Need a blue‑green cut‑over? Add version=1 to your CSV and promote it later:

Fast Lookup API

Returns {statusCode:301, redirectURL:"/sneakers"} from server in ~ 1ms. Parameters let you override host, version, or testing time, and you can push paths via the Path header to preserve query strings exactly.

Edge or Origin? You Choose

Because Harper runs identically on a single VM, a Kubernetes cluster, or geo‑distributed edge nodes, you can:

  1. Centralize at the origin for simple architectures.
  2. Fan‑out to edge instances (or have your CDN call the /checkredirect API) for single‑digit‑ms global round‑trips.

Either way, scaling up is literally adding another Harper node—no extra services to wire.

Deploying to Dev, Staging, Prod

The CLI packages the repo (or pulls from npm/GitHub), ships it to the remote instance with rolling restarts for zero downtime.

Ready to Test It Yourself?

The redirect problem is solved; now you can get back to building features. Happy routing!

When your URL map changes, every millisecond spent in a 404 costs rankings, revenue, and trust. The Harper Redirector lets you manage millions of redirects with 1 millisecond P95 lookups—without bolting on a separate database, cache, or edge worker. Below is a quick technical tour so you can clone the repo and start stress‑testing it today.


Why a Dedicated Redirect Engine?

Scale

  • Legacy approach: Apache/Nginx conf files grow linearly and reload slowly.
  • Harper Redirector: Horizontally sharded tables; handling hundreds of millions of rules is routine. 

Latency

  • Legacy approach: Database lookups or client‑side JavaScript add extra round‑trips.
  • Harper Redirector: In‑memory index inside the Harper runtime delivers sub‑millisecond lookups

Ops

  • Legacy Approach: Redirects scattered across YAML files, CDN rules, and spreadsheets.
  • Harper Redirector: One CSV/JSON import or REST write—fully versioned and promotable in bulk. 

Under the Hood

  • Smart matching – Host‑aware lookups, optional regex paths, and query‑string operations (qs:preserve, qs:filter) so one rule can handle thousands of permutations
  • Versioning – Flip activeVersion in the version table to atomically swap an entire redirect set—perfect for re‑platform launches. 

Metrics out of the box – Every hit is written to a metrics stream; drop it into Grafana or the Harper Analytics API for real‑time insight.

3‑Step Local Spin‑Up

Requires the Harper CLI (npm i -g harperdb).

The harperdb dev . command will automatically watch for file changes within the component directory and restart the Harper threads when changes are detected.

Importing Rules

Fields include path, redirectURL, optional utcStartTime/EndTime, and regex flag. JSON is equally accepted.

Need a blue‑green cut‑over? Add version=1 to your CSV and promote it later:

Fast Lookup API

Returns {statusCode:301, redirectURL:"/sneakers"} from server in ~ 1ms. Parameters let you override host, version, or testing time, and you can push paths via the Path header to preserve query strings exactly.

Edge or Origin? You Choose

Because Harper runs identically on a single VM, a Kubernetes cluster, or geo‑distributed edge nodes, you can:

  1. Centralize at the origin for simple architectures.
  2. Fan‑out to edge instances (or have your CDN call the /checkredirect API) for single‑digit‑ms global round‑trips.

Either way, scaling up is literally adding another Harper node—no extra services to wire.

Deploying to Dev, Staging, Prod

The CLI packages the repo (or pulls from npm/GitHub), ships it to the remote instance with rolling restarts for zero downtime.

Ready to Test It Yourself?

The redirect problem is solved; now you can get back to building features. Happy routing!

Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups—no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups—no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right
Discover how the Harper Redirector component enables ultra-fast, scalable, and centralized URL redirection with 1ms lookups—no external cache or DB needed. Learn how to deploy, manage, and monitor millions of redirects using a simple CSV or API interface.

Download

White arrow pointing right

Explore Recent Resources

Blog
GitHub Logo

Answer Engine Optimization: How to Get Cited by AI Answers

Answer Engine Optimization (AEO) is the next evolution of SEO. Learn how to prepare your content for Google’s AI Overviews, Perplexity, and other answer engines. From structuring pages to governing bots, discover how to stay visible, earn citations, and capture future traffic streams.
Search Optimization
Blog
Answer Engine Optimization (AEO) is the next evolution of SEO. Learn how to prepare your content for Google’s AI Overviews, Perplexity, and other answer engines. From structuring pages to governing bots, discover how to stay visible, earn citations, and capture future traffic streams.
Colorful geometric illustration of a dog's head in shades of purple, pink and teal.
Martin Spiek
SEO Subject Matter Expert
Blog

Answer Engine Optimization: How to Get Cited by AI Answers

Answer Engine Optimization (AEO) is the next evolution of SEO. Learn how to prepare your content for Google’s AI Overviews, Perplexity, and other answer engines. From structuring pages to governing bots, discover how to stay visible, earn citations, and capture future traffic streams.
Martin Spiek
Sep 2025
Blog

Answer Engine Optimization: How to Get Cited by AI Answers

Answer Engine Optimization (AEO) is the next evolution of SEO. Learn how to prepare your content for Google’s AI Overviews, Perplexity, and other answer engines. From structuring pages to governing bots, discover how to stay visible, earn citations, and capture future traffic streams.
Martin Spiek
Blog

Answer Engine Optimization: How to Get Cited by AI Answers

Answer Engine Optimization (AEO) is the next evolution of SEO. Learn how to prepare your content for Google’s AI Overviews, Perplexity, and other answer engines. From structuring pages to governing bots, discover how to stay visible, earn citations, and capture future traffic streams.
Martin Spiek
Case Study
GitHub Logo

The Impact of Early Hints - Auto Parts

A leading U.S. auto parts retailer used Harper’s Early Hints technology to overcome Core Web Vitals failures, achieving faster load speeds, dramatically improved indexation, and an estimated $8.6M annual revenue uplift. With minimal code changes, the proof-of-concept validated that even small performance gains can unlock significant growth opportunities for large-scale e-commerce businesses.
Early Hints
Case Study
A leading U.S. auto parts retailer used Harper’s Early Hints technology to overcome Core Web Vitals failures, achieving faster load speeds, dramatically improved indexation, and an estimated $8.6M annual revenue uplift. With minimal code changes, the proof-of-concept validated that even small performance gains can unlock significant growth opportunities for large-scale e-commerce businesses.
Colorful geometric illustration of a dog's head resembling folded paper art in shades of teal and pink.
Harper
Case Study

The Impact of Early Hints - Auto Parts

A leading U.S. auto parts retailer used Harper’s Early Hints technology to overcome Core Web Vitals failures, achieving faster load speeds, dramatically improved indexation, and an estimated $8.6M annual revenue uplift. With minimal code changes, the proof-of-concept validated that even small performance gains can unlock significant growth opportunities for large-scale e-commerce businesses.
Harper
Sep 2025
Case Study

The Impact of Early Hints - Auto Parts

A leading U.S. auto parts retailer used Harper’s Early Hints technology to overcome Core Web Vitals failures, achieving faster load speeds, dramatically improved indexation, and an estimated $8.6M annual revenue uplift. With minimal code changes, the proof-of-concept validated that even small performance gains can unlock significant growth opportunities for large-scale e-commerce businesses.
Harper
Case Study

The Impact of Early Hints - Auto Parts

A leading U.S. auto parts retailer used Harper’s Early Hints technology to overcome Core Web Vitals failures, achieving faster load speeds, dramatically improved indexation, and an estimated $8.6M annual revenue uplift. With minimal code changes, the proof-of-concept validated that even small performance gains can unlock significant growth opportunities for large-scale e-commerce businesses.
Harper