type: service
status: active
timestamp: 2026-06-20
tags: [short-link, cloudflare, worker, oriz-omnipost, primary]

Cloudflare Worker short-link (s.oriz.in)

Self-hosted URL shortener at s.oriz.in — 100k req/day free

Cloudflare Worker short-link (s.oriz.in)

Role

Mints short URLs of the shape https://s.oriz.in/<slug> that 302 to canonical pages on blog.oriz.in (or any other family URL). The primary consumer is @chirag127/oriz-omnipost — when a cross-post target platform refuses long content, the adapter posts a teaser + a unique short link instead of the full body. Each cross-post mints its own slug so click attribution per platform is trivial.

Secondary use: any time the family wants a memorable, self-owned short URL for a tweet, talk, or QR code (e.g. s.oriz.in/v2, s.oriz.in/cv).

Free tier

Card / subscription required?

NO. Inherits from the family Cloudflare account. No payment method needed.

Alternatives

We picked self-hosted on Cloudflare Worker because: custom domain (s.oriz.in) keeps brand cohesion, KV gives us per-slug analytics for free, no third-party can deprecate or rate-limit us, and it fits the existing infra one-line.

Quota mitigation — cache the 301 itself

The free tier is 100,000 Worker requests/day per script. The mitigation is a single trick: cache the 301 redirect itself at the Cloudflare edge.

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:

A 301 is cacheable HTTP per RFC 7231 §6.4.2 — any CDN may cache it indefinitely. The Worker emits only a 301 — minimal CPU.

Realistic upper bound at family scale: ~30 platforms × ~10 cross-posts/day × 1.5 click avg ≈ ~450 omnipost clicks/day, plus linkroll + QR / talk slugs = ~1-2K Worker requests/day worst-case across all CF edge POPs. That’s 1-2% of the 100K/day free envelope, comfortably inside rules/interaction/never-hit-quotas.md.

Slugs are immutable by design. Once minted, a slug never re-points; retire by minting a new one. The cached 301 trick depends on this immutability — re-pointing would require a CF cache purge and create a window of inconsistency.

Trade-off — no analytics from cached visits. Cache hits never reach the Worker, so per-slug click counts undercount. The family accepts this; click attribution lives in Cloudflare Web Analytics plus UTM parameters on the destination page. The Worker’s /_stats/<slug> endpoint reports KV-stored mint counts only.

Full lock at decisions/architecture/url-shortener-quota-mitigation.md.

Swap cost

Low. The Worker is ~30 lines of TypeScript. Migration target candidates are all standard short-link APIs; swapping means changing the engine’s shortLink(canonicalUrl) helper to call a different endpoint.

Why this is our pick

Cross-refs


Edit on GitHub · Back to index