Virke Sites

Static hosting at the edge. Deploy any static output directory and it's live globally in seconds. VCL serves all static site traffic for free — no compute charges on page views.

How It Works

CLI uploads files to Object Storage → API updates Edge Dictionaries → CDN purge. VCL resolves which version to serve per request using a priority chain: preview > canary > production. All operations are dictionary updates — no VCL redeploy, no rebuild, no restart.

Storage Layout

Every deploy creates a new versioned path in Object Storage. Multiple versions coexist. Edge Dictionaries control which version is active.

virke-projects/
├── {project-slug}/
│   ├── {deploy-id}/          # deploy a1b2c3f
│   │   ├── index.html
│   │   └── assets/
│   │       ├── main.x9y8z7.js
│   │       └── style.w6v5u4.css
│   ├── {deploy-id-2}/        # previous deploy
│   └── {deploy-id-3}/        # ← currently active

Request Flow

Version resolution priority

  1. Preview cookie set? → look up project in previews dictionary
  2. Canary active? → check canary dictionary, sticky cookie assigns group
  3. Production → read versions dictionary

URLs with file extensions fetch the exact file. URLs without extensions fall back to index.html (SPA fallback).

Performance

Operation Cold Warm
Serve HTML 617ms 40ms
SPA fallback (2 lookups) 380ms 43ms
404 (failed lookup) 245ms

Deploy Operations

Deploy (production)

The deploy flow: build locally → upload files to Object Storage → update Edge Dictionary → purge CDN → record in control plane DB.

Step Latency
File upload (3 files) 911ms
Edge Dictionary update ~1–2s
CDN purge ~200ms
Total deploy 2–3s

Rollback

No rebuild, no re-upload. Update the Edge Dictionary to point at the old deploy-id + purge CDN.

virke rollback           # previous deployment
virke rollback abc123    # specific deployment

Rollback latency: ~1.9s (dictionary update + purge only).

Canary deploys

virke canary start <deploy-id> <weight>   # start with % traffic
virke canary adjust <weight>              # adjust traffic split
virke canary promote                      # promote to production
virke canary abort                        # revert to stable

Users are assigned to canary or stable group via sticky cookie. Cookie assignment uses weighted random on first visit.

Preview environments

virke deploy --preview

Preview deployments are cookie-activated and shareable. Visit the preview URL to set a cookie, then all subsequent requests serve the preview version.

Operations summary

Operation What Happens Speed
Deploy Upload files + dictionary update + purge ~2–3s
Rollback Dictionary update + purge ~1.9s
Start canary Set canary dictionary entry Instant
Promote canary Move to versions, delete canary, purge Instant
Create preview Set preview dictionary entry Instant

Cache Strategy

Header Value Purpose
Surrogate-Control max-age=86400 CDN cache (24h, stripped before client)
Surrogate-Key site-{slug} Targeted purge per project
Cache-Control (HTML) public, max-age=300 Browser cache (5 min)
Cache-Control (hashed assets) immutable, max-age=31536000 1 year for hashed assets

CLI Commands

virke deploy                  # deploy to production
virke deploy --preview        # deploy to preview URL
virke rollback [deploy-id]    # roll back
virke canary start <id> <w>   # start canary
virke canary adjust <weight>  # adjust traffic
virke canary promote          # promote canary
virke canary abort            # abort canary
virke deployments             # list history
virke domains add <domain>    # add custom domain

Further Reading