cloudflare-workers-url-shortner

Build a URL shortener on Cloudflare Workers with Upstash Redis and D1.

39|2|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/ferminrp/agent-skills --skill cloudflare-workers-url-shortner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-workers-url-shortner
Source: https://github.com/ferminrp/agent-skills/tree/main/skills/cloudflare-workers-url-shortner
Command: npx skills add https://github.com/ferminrp/agent-skills --skill cloudflare-workers-url-shortner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Builds a fast and observable URL shortener on Cloudflare Workers using Upstash Redis and D1.

Core Features & Use Cases

  • Create shortlinks and redirects with low latency
  • Track clicks and analytics in a non-blocking fashion
  • Capture request metadata (country/city/ip/user-agent) for analytics
  • Throttled alerts on persistence failures (e.g., Telegram)

Quick Start

Create a shortlink for a destination URL using the Cloudflare Workers URL Shortner setup.

Frequently Asked Questions about cloudflare-workers-url-shortner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a URL shortener on Cloudflare Workers?

You can build a URL shortener on Cloudflare Workers by using Upstash Redis to store target URLs and a D1 database to log events. This setup handles low-latency redirects and tracks click analytics.

How does non-blocking click analytics work for redirects on Cloudflare Workers?

Non-blocking click analytics captures request metadata like country, city, IP, and user-agent during redirects without delaying the response. Click counts are stored in Redis, while events are logged in D1.

Do I need Upstash Redis and D1 to track URL shortener analytics?

Yes, this URL shortener requires Upstash Redis and D1. Redis keys store the target URLs and click counts for fast retrieval, while D1 provides the event log schema for detailed analytics tracking.

What is the best way to handle persistence failure alerts for a URL shortener?

The best way to handle persistence failures is through throttled alerts. When the URL shortener fails to log click analytics to D1, it sends throttled alerts via Telegram to prevent notification flooding.

Can I capture request metadata like IP and user-agent for URL redirects on Cloudflare Workers?

Yes, you can capture request metadata including country, city, IP, and user-agent for URL redirects. The Cloudflare Workers environment provides this data to track click analytics in a non-blocking fashion.

Why use Redis instead of D1 for target URL storage in a Cloudflare Workers shortener?

Using Redis for target URL storage ensures low-latency redirects. D1 is used for the event log schema to record analytics, while Upstash Redis handles rapid key lookups and click counters.