← Blog

Deep Dive · Privacy Engineering

Three Layers of Referrer Stripping: How TraceNull Kills the Referer Header at Every Level

Published May 2025 · 8 min read · By the TraceNull Team

Most URL shorteners promise privacy but rely on a single mechanism to strip the Referer header. If that one layer fails — due to a browser quirk, a misconfigured proxy, or an edge case in the HTTP spec — your referrer data leaks silently to the destination site. The site owner sees where you came from, your affiliate network sees the intermediary, and your privacy guarantee is broken.

TraceNull takes a fundamentally different approach. We strip the Referer header at three independent layers of the stack: the application server (Node.js + Express), the reverse proxy (Caddy), and the HTML document itself (meta tag). If any single layer fails, the other two still protect you.

This article explains exactly how each layer works, why defense-in-depth matters for referrer privacy, and how you can verify it yourself.

Wait — What Is the Referer Header, and Why Should You Care?

When you click a link on Page A that takes you to Page B, your browser automatically sends an HTTP header called Referer (yes, the original HTTP spec has this typo baked in permanently). This header contains the full URL of Page A.

That means the destination site knows:

For affiliate marketers, this is a serious problem. If you shorten a link through a service that doesn't strip referrers properly, the merchant can see your traffic source, your landing page strategy, and potentially your entire funnel. Competitors monitoring referrer logs get a free look at your playbook.

Key insight: The Referer header isn't just a privacy issue for end users — it's a competitive intelligence leak for marketers and publishers who share links publicly.

Layer 1: Node.js Application Headers

The first line of defense lives in TraceNull's Express application. When a short link is resolved and the redirect response is generated, we set the Referrer-Policy header directly on the HTTP response.

// Express middleware for all redirect responses res.setHeader('Referrer-Policy', 'no-referrer'); res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');

The Referrer-Policy: no-referrer header instructs the browser to send absolutely no referrer information when following the redirect. This is the strictest possible value defined in the W3C Referrer Policy specification.

Why This Layer Alone Isn't Enough

Application-level headers can be overridden or dropped in several scenarios:

If this were our only layer, a single deployment mistake could silently expose referrer data. That's why we don't stop here.

Layer 2: Caddy Reverse Proxy Headers

TraceNull runs behind Caddy, a modern reverse proxy that handles TLS termination and HTTP/2. We configure Caddy to inject the Referrer-Policy header on every single response that leaves the server, regardless of what the application does.

# Caddyfile — applied to all responses header { Referrer-Policy "no-referrer" X-Content-Type-Options "nosniff" X-Frame-Options "DENY" }

This is a server-level enforcement that operates independently of the Node.js application. Even if the Express middleware were disabled, misconfigured, or bypassed entirely, Caddy would still set the header.

Why Two Header Layers?

You might wonder: if both layers set the same header, isn't one redundant? That's exactly the point. Redundancy is the foundation of defense-in-depth security.

Consider these real-world failure scenarios:

Failure ScenarioLayer 1 (Node.js)Layer 2 (Caddy)User Protected?
Express middleware bug❌ Fails✅ Sets header✅ Yes
Caddy config reload error✅ Sets header❌ Fails✅ Yes
Both working normally✅ Sets header✅ Sets header✅ Yes
Both fail simultaneously❌ Fails❌ Fails✅ Layer 3 catches it

The probability of both the application and the proxy failing simultaneously on the same request is extremely low. But even in that worst case, we have Layer 3.

Layer 3: HTML Meta Tag (The Client-Side Guarantee)

For redirect pages that briefly render HTML before forwarding the user (such as password-protected links or interstitial pages), TraceNull injects a <meta> tag directly into the HTML document:

<meta name="referrer" content="no-referrer">

This tag is parsed by the browser before any navigation occurs. It serves as a client-side instruction that's completely independent of HTTP headers. Even if a network intermediary (corporate proxy, ISP, CDN) strips all custom HTTP headers from the response, the meta tag survives because it's embedded in the HTML body.

When the Meta Tag Saves You

The meta tag is the ultimate fallback. It's baked into the document itself — no server configuration, proxy, or middlebox can remove it without rewriting the HTML payload.

How the Three Layers Work Together

Here's the complete flow when someone clicks a TraceNull short link:

1

Request arrives at Caddy. Caddy terminates TLS, applies security headers including Referrer-Policy: no-referrer, and forwards the request to Node.js.

2

Node.js resolves the slug. Express looks up the short link in SQLite, sets its own Referrer-Policy: no-referrer header, and prepares the response.

3

For direct redirects (301/302): The browser receives the redirect with double-layer Referrer-Policy headers. No referrer is sent to the destination.

4

For HTML-rendered pages (password gates, interstitials): The browser also receives the <meta name="referrer" content="no-referrer"> tag embedded in the page. Three layers active simultaneously.

Verify It Yourself

Don't take our word for it. You can verify TraceNull's referrer stripping using free tools:

Method 1: Browser DevTools

  1. Create a short link at tracenull.cc
  2. Open your browser's Developer Tools (F12) → Network tab
  3. Click the short link
  4. Inspect the redirect response headers — you'll see Referrer-Policy: no-referrer
  5. Check the request to the destination — the Referer header will be absent

Method 2: Use a Referrer Checker

  1. Create a TraceNull short link pointing to a referrer-checking service like https://www.whatismyreferer.com/
  2. Click the short link
  3. The checker will show no referrer — confirming the headers were stripped

Method 3: cURL Inspection

curl -I https://tracenull.cc/go/YOUR_SLUG

Look for Referrer-Policy: no-referrer in the response headers. It will be there, set by both Caddy and Node.js.

Why Most Shorteners Don't Do This

The honest answer: because it's unnecessary for their business model. Services like Bitly and TinyURL want referrer data to flow — it powers their analytics dashboards and the data they sell to enterprise customers. Stripping referrers would undermine their core revenue model.

Even privacy-focused alternatives often implement only a single layer (usually just the meta tag or just one header). That's better than nothing, but it leaves gaps that real-world network conditions can exploit.

Be skeptical of privacy claims. If a URL shortener says it strips referrers, ask how many layers of protection it uses. A single point of failure means a single point of leakage.

Who Benefits Most from Triple-Layer Stripping?

The Bottom Line

Privacy isn't a feature you bolt on with a single HTTP header and call it done. It's an engineering discipline that requires redundancy, verification, and a healthy paranoia about failure modes.

TraceNull's three-layer referrer stripping — Node.js application headers, Caddy server headers, and HTML meta tags — ensures that no single point of failure can expose your referrer data. Each layer operates independently, and all three would have to fail simultaneously for any leakage to occur.

That's what privacy-first actually means: not one wall, but three.

Try Triple-Layer Referrer Stripping Free

Create a short link with TraceNull and verify the referrer is stripped at every layer. No account required for free links.

Strip Your First Link →