Review Petdex Infrastructure Implementation Plans
mainThe plans/README.md file tracks the execution of infrastructure cost-optimization plans for Petdex, specifically focusing on the migration from Vercel to Cloudflare and reducing infrastructure expenses. The plans are prioritized by impact and effort, following a specific execution order to mitigate risks like Error 1027 outages.
Key Optimization Strategies implemented:
- Edge Caching: Serving assets from
assets.petdex.devvia Cloudflare edge cache with specific TTL overrides and CORS settings. - HTML Caching: Making anonymous public HTML cacheable by Cloudflare by managing
NEXT_LOCALEcookies andCloudflare-CDN-Cache-Controlheaders. - Static/ISR Conversion: Converting high-traffic routes like
/requests,/leaderboard, and/downloadto static or Incremental Static Regeneration (ISR) to reduce dynamic compute. - Middleware Optimization: Reducing middleware overhead by offloading WAF tasks and optimizing Clerk authentication scopes.
- Server-First Shell: Reducing client-side JS size by dropping global Clerk/header requirements for public shells.