Performance: Deploying to Cloudflare Pages
This affects the page load speed by optimizing how quickly the site files are delivered from the edge network to the user.
Deploy site on Cloudflare Pages which uses Cloudflare's global edge network.Deploy site on a single distant server without CDN integration.
| Pattern | Network Latency | Cache Efficiency | Load Time Impact | Verdict |
|---|---|---|---|---|
| Single origin server deployment | High for distant users | Low | Slower LCP | [X] Bad |
| Cloudflare Pages edge deployment | Low due to edge caching | High | Faster LCP | [OK] Good |
npm run build to create the static files for deployment.npm run build is the correct command.build: command: "npm run build" directory: "dist"What will Cloudflare Pages do after you push your Astro site code?
npm run build, which builds the Astro site into static files.dist is where Astro puts the built site files, so Cloudflare Pages deploys from there.scripts section of package.json, usually as "build": "astro build" or similar.Pass the test and this pattern moves unknown