The experiments in this repository demonstrate various Cloudflare platform features. Each feature enables developers to build powerful applications that run at the edge, close to users worldwide.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/shrinathsnayak/cloudflare-experiments/llms.txt
Use this file to discover all available pages before exploring further.
Core Features
Cloudflare Workers
Edge compute platform that runs JavaScript/TypeScript on Cloudflare’s global network.All experiments run on Workers, providing:
- Global deployment in 300+ cities
- Sub-millisecond cold starts
- Zero-config scaling
- Request/Response manipulation
- Standard Web APIs (fetch, URL, etc.)
Workers AI
Serverless AI inference at the edge with built-in models.Run language models directly from Workers:
- Text generation and summarization
- No GPU infrastructure required
- Pay-per-inference pricing
- Multiple model options
Browser Rendering
Headless browser automation powered by Puppeteer on the edge.Capture screenshots and interact with web pages:
- Full Chrome browser in Workers
- Screenshot capture
- Page navigation and interaction
- No browser infrastructure to manage
HTMLRewriter
Streaming HTML parser for transforming HTML on the fly.Parse and extract data from HTML without buffering:
- Streaming HTML transformation
- CSS selector-based parsing
- Low memory overhead
- Regex-based extraction patterns
Storage Features
D1 (SQL Database)
SQLite database at the edge with global replication.Serverless SQL for relational data:
- SQLite syntax and compatibility
- Automatic backups
- Read replication
- Schema migrations
- Low-latency queries from edge
- Link Shortener (primary storage)
Workers KV
Global key-value store optimized for high-read workloads.Distributed KV storage:
- Eventually consistent reads
- Global edge caching
- TTL support
- Ideal for read-heavy caching
- Link Shortener (read-through cache)
R2 Storage
Object storage compatible with S3 APIs, with zero egress fees.Store files and assets:
- S3-compatible API
- No egress charges
- Public and private buckets
- Custom metadata support
- Ideal for images, videos, files
Network Features
Edge Networking
Global network with advanced request handling.Access network-level information:
- Geolocation data (country, city, region)
- Data center (colo) information
- Request metadata
- TLS/SSL information
Fetch API
Standards-based HTTP client with edge optimizations.Make HTTP requests from the edge:
- Standard Web Fetch API
- Automatic retries and failover
- Connection pooling
- Header manipulation
Feature Comparison
| Feature | Type | Use Case | Cold Start | Pricing Model |
|---|---|---|---|---|
| Workers | Compute | Edge functions | <1ms | Per request |
| Workers AI | AI/ML | Inference | ~50ms | Per inference |
| Browser Rendering | Compute | Screenshots, scraping | ~2s | Per session |
| D1 | Storage | Relational data | ~5ms | Reads + writes |
| KV | Storage | Caching | <1ms | Reads + writes |
| R2 | Storage | Object storage | ~10ms | Storage + operations |
Architecture Patterns
Experiments demonstrate several common patterns:Fetch + Parse Pattern
Fetch external HTML and parse with regex or HTMLRewriter:- Dependency Analyzer
- Website Metadata Extractor
- Website DevTools Inspector
AI Integration Pattern
Fetch content, extract text, and summarize with Workers AI:- AI Website Summary
- GitHub Repo Explainer
Storage Pattern
Combine D1 (primary) with KV (cache) for optimal performance:- Link Shortener (D1 + KV)
Object Storage Pattern
Public and private R2 buckets with direct URLs:- R2 Storage
Learn More
Cloudflare Developer Documentation
Official documentation for all Cloudflare developer products