Christian M
Dec 1, 2024
Technology Decision Record: Migration from GitHub Pages to Cloudflare Pages
Context
Konnektoren.help is a Single Page Application (SPA) built with Rust and Yew that requires client-side routing. Initially, we hosted the application on GitHub Pages due to its zero-cost hosting solution. However, we encountered significant limitations with routing and SEO optimization.
Problem-
Routing Issues:
- GitHub Pages doesn't natively support SPA routing
- We implemented a 404-based routing solution that redirected all routes to index.html
- This approach resulted in sending 404 HTTP status codes for valid routes
-
SEO Impact:
- Search engines interpreted our valid routes as error pages due to the 404 status codes
- This negatively impacted our search engine rankings
- Unable to configure proper HTTP response codes on GitHub Pages
- Configurable Routing:
# _redirects file
/about /index.html 200
/achievements /index.html 200
/challenge/* /index.html 200
# ... other routes
- Custom Headers:
# _headers file
/*
Access-Control-Allow-Origin: *
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
-
Deployment Workflow:
- Maintains simple git-based deployment
- Automatic builds and deployments on push
- Zero-downtime deployments
-
Cost Consideration:
- Remains within free tier limits
- Comparable to GitHub Pages in terms of cost (free)
- Proper HTTP status codes (200) for valid routes
- Improved SEO performance
- Better control over HTTP headers
- Maintained simple deployment process
- Enhanced security headers configuration
- Additional configuration files to maintain
- Team needs to learn Cloudflare Pages specifics
The migration to Cloudflare Pages solved our critical routing and SEO issues while maintaining a similar deployment workflow. The ability to configure redirects and headers made it the right choice for our SPA needs.
References- Cloudflare Pages Documentation
- Project Configuration Files:
_redirects_headers- GitHub Actions workflow
969 views969
Comments












