Skip to content

lightweight, client-only calendar web application. All data persists in the URL hash for instant sharing, No backend required. Optional AES-GCM password protection keeps shared links locked without a server

JavaScript
1.2 KB
Raw Blame
:80 {
    # Serve all files from the current directory
    file_server {
        hide .git .gitignore .dockerignore Dockerfile docker-compose.yaml Caddyfile LLM.md
    }
    
    # Compress responses
    encode gzip
    
    # Long cache for fingerprintable static assets only.
    @static_immutable {
        path *.png *.jpg *.jpeg *.gif *.svg *.ico *.woff *.woff2 *.ttf *.eot
    }
    header @static_immutable Cache-Control "public, max-age=31536000, immutable"

    # App code must be revalidated to avoid stale JS/CSS/JSON after deploys.
    @app_code {
        path *.js *.css *.json
        not path /sw.js
    }
    header @app_code Cache-Control "public, max-age=0, must-revalidate"

    # Always fetch the latest service worker script.
    @service_worker path /sw.js
    header @service_worker Cache-Control "no-cache, no-store, must-revalidate"
    
    # Dynamic content (HTML) - don't cache
    @html {
        path_regexp ^.*\.html?$
    }
    header @html Cache-Control "public, max-age=0, must-revalidate"
    
    # Hash-calendar SPA: rewrite hash-based routes to index.html
    try_files {path} /index.html
    
    # Log requests
    log {
        output stdout
        format console
    }
}