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
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

git clone https://github.com/HarperDB/template-redirector.git
cd template-redirector
harperdb dev .           # Hot‑reloads while you edit

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

curl http://localhost:9926/redirect \
  --header "Content-Type: text/csv" \
  --data-binary @redirects.csv

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:

PUT /version
{ "activeVersion": 1 }

Fast Lookup API

GET /checkredirect?path=/shoe-sale&h=www.shop.com&ho=1

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

harperdb deploy_component \
  project=redirector \
  package=https://github.com/HarperDB/template-redirector \
  target=prod.mydomain.io \
  username=$USER password=$PASS \
  restart=true replicated=true

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

git clone https://github.com/HarperDB/template-redirector.git
cd template-redirector
harperdb dev .           # Hot‑reloads while you edit

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

curl http://localhost:9926/redirect \
  --header "Content-Type: text/csv" \
  --data-binary @redirects.csv

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:

PUT /version
{ "activeVersion": 1 }

Fast Lookup API

GET /checkredirect?path=/shoe-sale&h=www.shop.com&ho=1

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

harperdb deploy_component \
  project=redirector \
  package=https://github.com/HarperDB/template-redirector \
  target=prod.mydomain.io \
  username=$USER password=$PASS \
  restart=true replicated=true

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

News
GitHub Logo

Harper 5.0 Is Here: Open Source, RocksDB, and a Runtime Built for the Agentic Era

Harper 5.0 launches with a fully open-source core under Apache 2.0, RocksDB as a native storage engine alongside LMDB, and source-available Harper Pro. This release delivers a unified runtime purpose-built for agentic engineering, from prototype to production.
Product Update
News
Harper 5.0 launches with a fully open-source core under Apache 2.0, RocksDB as a native storage engine alongside LMDB, and source-available Harper Pro. This release delivers a unified runtime purpose-built for agentic engineering, from prototype to production.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM & Marketing
News

Harper 5.0 Is Here: Open Source, RocksDB, and a Runtime Built for the Agentic Era

Harper 5.0 launches with a fully open-source core under Apache 2.0, RocksDB as a native storage engine alongside LMDB, and source-available Harper Pro. This release delivers a unified runtime purpose-built for agentic engineering, from prototype to production.
Aleks Haugom
Apr 2026
News

Harper 5.0 Is Here: Open Source, RocksDB, and a Runtime Built for the Agentic Era

Harper 5.0 launches with a fully open-source core under Apache 2.0, RocksDB as a native storage engine alongside LMDB, and source-available Harper Pro. This release delivers a unified runtime purpose-built for agentic engineering, from prototype to production.
Aleks Haugom
News

Harper 5.0 Is Here: Open Source, RocksDB, and a Runtime Built for the Agentic Era

Harper 5.0 launches with a fully open-source core under Apache 2.0, RocksDB as a native storage engine alongside LMDB, and source-available Harper Pro. This release delivers a unified runtime purpose-built for agentic engineering, from prototype to production.
Aleks Haugom
Podcast
GitHub Logo

Maintaining Momentum: Versioning, Stability & the Road to Nuxt 5 with Daniel Roe

In this podcast episode, Daniel Roe, lead of the Nuxt framework, shares insights on Nuxt 3, 4, and the upcoming Nuxt 5 release. We discuss open-source development, upgrading Nuxt apps, Vue-powered full-stack web apps, version maintenance, and the future of modern web development.
Select*
Podcast
In this podcast episode, Daniel Roe, lead of the Nuxt framework, shares insights on Nuxt 3, 4, and the upcoming Nuxt 5 release. We discuss open-source development, upgrading Nuxt apps, Vue-powered full-stack web apps, version maintenance, and the future of modern web development.
Person with short hair wearing a light blue patterned shirt, smiling widely outdoors with blurred greenery and trees in the background.
Austin Akers
Head of Developer Relations
Podcast

Maintaining Momentum: Versioning, Stability & the Road to Nuxt 5 with Daniel Roe

In this podcast episode, Daniel Roe, lead of the Nuxt framework, shares insights on Nuxt 3, 4, and the upcoming Nuxt 5 release. We discuss open-source development, upgrading Nuxt apps, Vue-powered full-stack web apps, version maintenance, and the future of modern web development.
Austin Akers
Apr 2026
Podcast

Maintaining Momentum: Versioning, Stability & the Road to Nuxt 5 with Daniel Roe

In this podcast episode, Daniel Roe, lead of the Nuxt framework, shares insights on Nuxt 3, 4, and the upcoming Nuxt 5 release. We discuss open-source development, upgrading Nuxt apps, Vue-powered full-stack web apps, version maintenance, and the future of modern web development.
Austin Akers
Podcast

Maintaining Momentum: Versioning, Stability & the Road to Nuxt 5 with Daniel Roe

In this podcast episode, Daniel Roe, lead of the Nuxt framework, shares insights on Nuxt 3, 4, and the upcoming Nuxt 5 release. We discuss open-source development, upgrading Nuxt apps, Vue-powered full-stack web apps, version maintenance, and the future of modern web development.
Austin Akers
Blog
GitHub Logo

Most LLM Calls Are Waste. Here's the Math.

Semantic caching for LLMs can reduce API costs by 20–70% by reusing similar responses. Combined with deterministic routing and improved retrieval, enterprises can significantly lower LLM usage, though effectiveness varies by workload and improves over time.
Blog
Semantic caching for LLMs can reduce API costs by 20–70% by reusing similar responses. Combined with deterministic routing and improved retrieval, enterprises can significantly lower LLM usage, though effectiveness varies by workload and improves over time.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM & Marketing
Blog

Most LLM Calls Are Waste. Here's the Math.

Semantic caching for LLMs can reduce API costs by 20–70% by reusing similar responses. Combined with deterministic routing and improved retrieval, enterprises can significantly lower LLM usage, though effectiveness varies by workload and improves over time.
Aleks Haugom
Apr 2026
Blog

Most LLM Calls Are Waste. Here's the Math.

Semantic caching for LLMs can reduce API costs by 20–70% by reusing similar responses. Combined with deterministic routing and improved retrieval, enterprises can significantly lower LLM usage, though effectiveness varies by workload and improves over time.
Aleks Haugom
Blog

Most LLM Calls Are Waste. Here's the Math.

Semantic caching for LLMs can reduce API costs by 20–70% by reusing similar responses. Combined with deterministic routing and improved retrieval, enterprises can significantly lower LLM usage, though effectiveness varies by workload and improves over time.
Aleks Haugom
Blog
GitHub Logo

Build a Conversational AI Agent on Harper in 5 Minutes

Build a conversational AI agent in minutes using Harper’s unified platform. This guide shows how to create, deploy, and scale real-time AI agents with built-in database, vector search, and APIs—eliminating infrastructure complexity for faster development.
Blog
Build a conversational AI agent in minutes using Harper’s unified platform. This guide shows how to create, deploy, and scale real-time AI agents with built-in database, vector search, and APIs—eliminating infrastructure complexity for faster development.
A smiling man with a beard and salt-and-pepper hair stands outdoors with arms crossed, wearing a white button-down shirt.
Stephen Goldberg
CEO & Co-Founder
Blog

Build a Conversational AI Agent on Harper in 5 Minutes

Build a conversational AI agent in minutes using Harper’s unified platform. This guide shows how to create, deploy, and scale real-time AI agents with built-in database, vector search, and APIs—eliminating infrastructure complexity for faster development.
Stephen Goldberg
Apr 2026
Blog

Build a Conversational AI Agent on Harper in 5 Minutes

Build a conversational AI agent in minutes using Harper’s unified platform. This guide shows how to create, deploy, and scale real-time AI agents with built-in database, vector search, and APIs—eliminating infrastructure complexity for faster development.
Stephen Goldberg
Blog

Build a Conversational AI Agent on Harper in 5 Minutes

Build a conversational AI agent in minutes using Harper’s unified platform. This guide shows how to create, deploy, and scale real-time AI agents with built-in database, vector search, and APIs—eliminating infrastructure complexity for faster development.
Stephen Goldberg
Podcast
GitHub Logo

Inside PixiJS, AT Protocol, and Modern Game Development with Trezy Who

Trezy shares his journey from professional drummer and filmmaker to software engineer and open source maintainer. Learn about PixieJS, game development, AT Proto, BlueSky, data sovereignty, and how developers can confidently contribute to open source projects.
Select*
Podcast
Trezy shares his journey from professional drummer and filmmaker to software engineer and open source maintainer. Learn about PixieJS, game development, AT Proto, BlueSky, data sovereignty, and how developers can confidently contribute to open source projects.
Person with short hair wearing a light blue patterned shirt, smiling widely outdoors with blurred greenery and trees in the background.
Austin Akers
Head of Developer Relations
Podcast

Inside PixiJS, AT Protocol, and Modern Game Development with Trezy Who

Trezy shares his journey from professional drummer and filmmaker to software engineer and open source maintainer. Learn about PixieJS, game development, AT Proto, BlueSky, data sovereignty, and how developers can confidently contribute to open source projects.
Austin Akers
Mar 2026
Podcast

Inside PixiJS, AT Protocol, and Modern Game Development with Trezy Who

Trezy shares his journey from professional drummer and filmmaker to software engineer and open source maintainer. Learn about PixieJS, game development, AT Proto, BlueSky, data sovereignty, and how developers can confidently contribute to open source projects.
Austin Akers
Podcast

Inside PixiJS, AT Protocol, and Modern Game Development with Trezy Who

Trezy shares his journey from professional drummer and filmmaker to software engineer and open source maintainer. Learn about PixieJS, game development, AT Proto, BlueSky, data sovereignty, and how developers can confidently contribute to open source projects.
Austin Akers