type: decision
status: active
timestamp: 2026-06-20
tags: [short-link, cloudflare, worker, quota, caching, mitigation]

URL shortener quota mitigation — cache the 301 itself at the CF edge

s.oriz.in CF Worker, 100K req/day free tier script. We send `Cache-Control: public, max-age=31536000, immutable` on every\ 301 redirect so CF's edge caches the redirect itself; subsequent visitors hit\ the cache, not the Worker. With caching, only the first visitor per URL per edge\ POP per year burns a Worker request. Realistic upper bound at family-wide traffic\ is ~1-2K requests/day — well under 100K. No external shortener required.

URL shortener quota mitigation — cache the 301 itself at the CF edge

Decision

The family’s s.oriz.in shortener is a Cloudflare Worker. The free tier is 100,000 Worker requests/day per script. The user asked: “Is in there any completely free service … I will overpower the overrun the cloud player workers limit if I use this. How to mitigate?”

The mitigation is a single trick: cache the 301 redirect itself at the Cloudflare edge.

// sketch — actual Worker is ~30 LoC
return new Response(null, {
  status: 301,
  headers: {
    Location: target,
    'Cache-Control': 'public, max-age=31536000, immutable',
    'CDN-Cache-Control': 'public, max-age=31536000, immutable',
  },
});

With this header set:

No external shortener is added. No card. No Bitly. No paid tier.

Why this works

Realistic upper bound at family scale

Back-of-envelope:

Add a 2× safety margin for cold-cache spread across CF’s ~300+ edge POPs (each POP misses cache once per slug per year): worst case ~1-2K Worker requests/day. The free tier is 100,000/day. We sit at 1-2% of headroom, comfortably inside rules/interaction/never-hit-quotas.md.

Implications

Cross-refs


Edit on GitHub · Back to index