Cloudflare learnings

Just a guy who loves to write code and watch anime.
Search for a command to run...

Just a guy who loves to write code and watch anime.
No comments yet. Be the first to comment.
Qualities that make outstanding builders.

Bipedal vs quadrupedal: how many legs This is about the number of legs the creature walks on. Bipedal. Two legs. Humans, ostriches, T-rex, kangaroos, most fantasy humanoids. Quadrupedal. Four legs. Do

Intro You hear "lerp" and "smoothstep" everywhere in game dev. They sound like math jargon. They're not. Both are small tools that do the same job: smoothly move from one value to another. The problem

What is Kinematics Kinematics is the math field. It's the study of how things move without worrying about forces (which would be dynamics). FK and IK are the two branches: forward kinematics and inver

Intro Textures are usually the biggest cost in a 3D scene. Memory, bandwidth, and load time all get eaten by them. Resizing them is the obvious lever. There's more. This post is about the less obvious

Serverless execution environment running JavaScript/WebAssembly at the edge across 340+ global data centers.
Lightweight runtime (Node.js-like, edge-optimized)
Multi-language support (TypeScript, Rust, C++ via WebAssembly)
HTTP request-response model
Global Distribution → Minimal latency (closest data center)
Edge Processing → Faster response times
Auto-scaling → Handles traffic spikes without manual intervention
Globally distributed storage for lightweight data.
Technical specs:
Consistency: Eventual (~60 seconds propagation)
Best for: Configuration files, user preferences, caching
Limitation: Potential stale reads during propagation window
S3-compatible storage for static assets.
Integration benefits:
Edge caching capability
Optimized delivery through Workers
File storage (images, videos, documents)
Runtime: Short-lived execution only
WebSockets: Limited support
File Operations: No direct file manipulation
Development: Some features require deployment for testing
Stream/transform data instead of direct file manipulation
Use external services for long-running tasks
Test critical features in staging environment
Custom Domains: Avoid worker.dev URLs (rate limits/blocking risk)
Caching Strategy: Cache frequent requests and static assets
Error Handling: Implement comprehensive error monitoring
Design for eventual consistency
Use frontend caching for immediate updates
Handle propagation delays gracefully
Leverage Cloudflare's observability tools
Monitor edge response times
Track cache hit rates
API Proxying: Fetch and serve data from backend systems
Authentication: Handle user auth at the edge
Dynamic Routing: Route requests based on logic/conditions
Edge Caching: Serve static content from nearest location
Asset Optimization: Transform images/files on-the-fly
CDN Enhancement: Add custom logic to content delivery
Real-time Transforms: Process data before delivery
Request Modification: Alter headers, routing, or responses
Middleware Logic: Add custom processing layers
Use Wrangler CLI for local testing
Test core logic locally
Deploy to staging for edge-specific features
Monitor performance in production
Test KV consistency behavior
Validate custom domain configuration
Confirm caching behavior
Monitor error rates post-deployment