## 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
- Deliver public assets through CDN for SvelteKit
- Where can I host Deliver public assets through CDN built with SvelteKit?
- I need a public-origin configuration, versioned asset build and observable cache behavior.

### Resource Requirements
- **Primitive: Compute**
- **Primitive: CDN**

### 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
- A SvelteKit project (vite build with @sveltejs/adapter-node then node build on the node-22 template)
- A bucket from `ample bucket create` with credentials passed as encrypted S3_* environment variables
- An Ample account token with servers:write, buckets:read

### 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
- **SvelteKit pattern fixture**  
  - Description: Verified CDN assets on SvelteKit.  
  - Source Ref: tests/deploy-canaries/sveltekit-patterns

### Limitations
- Verified on the node-22 template at s-1vcpu-1gb; other sizes and SvelteKit major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
- The CDN serves published-bucket objects only; cache rules, purge and TTL control are not verified.

### Cost Estimate
- **Currency:** USD  
- **Monthly Amount:** 5.0  
- **Basis:** size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty  
- **Components:**  
  - App server  
    - Size: s-1vcpu-1gb  
    - Quantity: 1.0  
    - Monthly Amount: 5.0  
- **Note:** Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

### Next Actions
- **Browse the catalog index**
- **Search published recipes by intent, stack and constraints**
- **Prepare a side-effect-free deployment plan for an authorized project**
- **Read the existing agent authentication setup**
- **Browse SvelteKit**
- **Browse Add CDN**
- **Browse Versioned static assets**
