DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsSite Keys & Client SitesCDN builds
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
OverviewSite keysThe /api/site surfaceThe insights beaconCDN buildsThe powered-by badgeBuilding a paired site SDK
Use Cases
Operations

CDN builds

Static assets on the edge, with the prefix baked at build time.

Updated July 26, 2026

On this page
  • One command
  • The order of operations matters
  • It never goes red because the CDN hiccuped
  • Two footguns the flow already avoids

One command

The site SDK ships a CLI that wraps the whole flow — wire it in as the site's build script:

shell
npx localplug build           # next build + upload changed assets + activate
npx localplug build --dry-run
npx localplug status          # active deployment + the site's asset prefix

(The command name follows the platform's own SDK branding; the flow underneath is the site CDN surface: manifest → upload → activate → status.)

The order of operations matters

  1. Resolve the CDN prefix first. The asset prefix must be known before next build — a runtime-only prefix silently kills hydration (a frozen page with zero console errors). The build runs with NEXT_PUBLIC_ASSET_PREFIX baked in, and next.config reads it:
typescript
assetPrefix: process.env.NEXT_PUBLIC_ASSET_PREFIX || undefined,
  1. Upload only what changed. Assets are content-addressed; the manifest call returns which hashes the CDN already has, and only new files upload — into the site's own namespace.
  2. Activate atomically. The new version becomes live in one step; there is no window where a page references assets that aren't there yet.

It never goes red because the CDN hiccuped

Anything missing or failing — no key, no network, a refused upload — degrades to a plain next build served from the origin. A deploy is never failed by its optimization.

Two footguns the flow already avoids

  • Fonts: self-hosted font files served through a CDN prefix without CORS headers silently fall back — use link-based font loading with CDN builds.
  • Canvas: CDN images drawn to a canvas without CORS taint it; anything that needs toDataURL (PDF export, cropping) should fetch bytes server-side instead.
PreviousThe insights beaconNextThe powered-by badge

On this page

  • One command
  • The order of operations matters
  • It never goes red because the CDN hiccuped
  • Two footguns the flow already avoids