我如何用 Cloudflare 建成 16,000 頁瀏覽器遊戲入口網站及 AI 工具目錄
How I Built a 16,000-Page Browser Game Portal & AI Tools Directory on Cloudflare
作者以 Astro + Cloudflare(Pages、Workers、D1、R2)建成 DashJoy Studio 瀏覽器遊戲入口網站及 Dorameow 雙語 AI 與開發者工具目錄,前者有 16,000+ 頁。
Over the past few months, I built and deployed two very different content-heavy web projects on the exact same stack—Astro + Cloudflare (Pages, Workers, D1, and R2)—with the goal of keeping infrastructure dead simple, fast globally, and cheap to maintain.
Here is a quick breakdown of what worked well, what broke along the way, and the architecture behind both sites.
Project 1: DashJoy Studio — A 16,000+ Page Browser Game Portal
DashJoy Studio is a lightweight browser game portal built for instant play on desktop, Chromebook, and mobile without downloads or forced sign-ups.
The stack & key lessons
Static generation + R2 for 69,000+ WebP thumbnails
Bundling tens of thousands of cover images directly inside the build output quickly hits deployment file limits. Moving all resized WebP covers and thumbnails (512px,192px,160px,96px) to Cloudflare R2 behind a custom image domain kept the Astro Pages deployment lean while delivering instant edge-cached images.Migrating votes, reports, and player comments to Workers + D1
Originally, broken-game reporting and voting ran in a small Docker container backed by SQLite on a VPS. Moving that entire API to Cloudflare Workers + D1 eliminated server maintenance, dropped cold-start latency globally, and made it easy to add a lightweight Player Comments system with rate limiting, spam-link filtering, and a built-in moderation dashboard.Dedicated "Ad-Free Originals" via Workers Static Assets
One common frustration on casual game portals is waiting through third-party pre-roll ads. To fix that, I created a separate static Workers project hosting ad-free HTML5 classics—like 2048, Tower Building, OutRun JS Racer, Classic Block Tetris, and Chess vs AI—adapted for dark backgrounds and consistent aspect ratios. You can try them directly in the Ad-Free Originals section.
Project 2: Dorameow — A Bilingual AI & Developer Tools Directory
Alongside the gaming portal, I also built Dorameow, a clean English/Chinese directory for curated AI products, open-source developer tools, and concise daily AI news digests.
Why Astro works so well for directories
- Zero client-side JavaScript by default: Category grids, tool comparison pages, and daily news posts render as pure HTML/CSS and load almost instantly.
- Simple bilingual routing: Keeping English and Chinese routes in a single Astro project makes it easy to publish daily updates without maintaining two separate codebases.
- No bloat: Minimal scripts, fast search/filtering, and clear categories so developers can actually find a useful tool in 10 seconds instead of scrolling through sponsored banners.
Takeaways for Indie Builders
- Split heavy media from your app deploy early (Cloudflare R2 saves a ton of pain once you pass a few thousand assets).
- Cloudflare D1 is more than enough for small community features like voting, reporting, comments, and leaderboards—no need to babysit a VPS database.
- Keep self-hosted sub-apps in separate deployments so updating one interactive feature never forces a full rebuild of a 16,000-page static site.
If you're building with Astro or Cloudflare Workers—or just want to test a quick ad-free game break—feel free to check out DashJoy Studio or Dorameow. Always happy to hear feedback!
來源:DEV Community · dev.to