← BACK TO LEACB
2025-12-05

My Cloudflare Pages Experience

DevOpsCloudflare

Why Cloudflare Pages

When it came time to deploy LEACB, I needed something fast, free, and reliable. Cloudflare Pages checked all the boxes: global CDN, automatic HTTPS, Git integration, and zero cost for personal projects.

The 8-Hour Journey

What I thought would be a 30-minute deploy turned into an 8-hour odyssey. Not because Cloudflare Pages is hard — it's actually beautifully simple — but because my project structure had assumptions that didn't map to static hosting.

The first build failed because of my directory structure. The second failed because of redirect rules. The third partially worked but CSS paths were wrong. Each failure taught me something about how static hosting actually works.

Build Loops & Redirects

The trickiest part was getting redirects right. My _redirects file needed exact syntax. One trailing slash in the wrong place created infinite redirect loops. One missing rule meant 404s on direct blog links.

"DevOps is 10% configuration and 90% debugging why the configuration doesn't work."

Structure Fixes

I learned that flat file structure matters for static hosting. Asset paths need to be relative or properly rooted. Module imports need correct MIME types. And importmap for Three.js needs to resolve against the CDN, not local files.

Going Live

When leacb.com finally loaded perfectly — 3D scene, particles, animations, all working on the global Cloudflare CDN — the 8-hour struggle was instantly worth it. Load times under 1 second from anywhere in the world. Automatic HTTP/3. Edge caching. All free.

Takeaways

  • Test your build locally with a static file server before deploying
  • Get your _redirects file right — it's the most common pain point
  • Use relative paths for assets to avoid domain-specific issues
  • Cloudflare Pages is excellent for static sites and SPAs