page:guides:sveltekit:cdn assets

Deliver public assets through CDN for SvelteKit

Summary

Cdn assets for a SvelteKit app on Ample. Verified on SvelteKit: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: vite build with @sveltejs/adapter-node then node build on the node-22 template.

Representative Queries

Resource Requirements

Infrastructure Requirements

  1. Compute
    • Status: Verified
    • Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
  2. CDN
    • Status: Verified
    • Summary: The CDN host serves objects from published buckets. It does not front app compute and is not a cache or key-value store.

Prerequisites

Workflow Steps

  1. Build and start
    • Body: vite build with @sveltejs/adapter-node then node build on the node-22 template; the server must bind 0.0.0.0 on PORT.
  2. Publish a bucket for public assets
    • Body: Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.
    • Command: ample bucket publish
  3. Verify
    • Body: Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.
    • Command: ample logs --kind build

Examples

Limitations

Cost Estimate

Next Actions