diff --git a/deploy/site/Caddyfile b/deploy/site/Caddyfile index 51db443..f8e6364 100644 --- a/deploy/site/Caddyfile +++ b/deploy/site/Caddyfile @@ -49,17 +49,35 @@ stream.89-167-122-160.sslip.io, stream.waow.tech { } } - # the archive playground: a cloudflare worker (zat.dev/strata) mounted - # under this host so the archive's site owns it. handle_path strips the - # prefix; the page uses relative urls so it needs the trailing slash. + # Public playground; static assets and a deploy-time summary snapshot. + root * /srv/site redir /strata /strata/ permanent - handle_path /strata/* { - reverse_proxy https://strata.zat.dev { - header_up Host strata.zat.dev + redir /_strata-preview /strata/ permanent + handle_path /_strata-preview/* { + redir * /strata{uri} permanent + } + handle /strata/* { + # Preserve summary API URLs for clients of the former UI. + @strata_api path /strata/api /strata/api/* + handle @strata_api { + uri strip_prefix /strata + reverse_proxy https://strata.zat.dev { + header_up Host strata.zat.dev + } + } + handle /strata/assets/* { + header Cache-Control "public, max-age=31536000, immutable" + file_server { + precompressed gzip + } + } + handle { + header Cache-Control "public, max-age=60, stale-while-revalidate=86400, stale-if-error=604800" + file_server { + precompressed gzip + } } } - - root * /srv/site @home path / /index.html handle @home { header Cache-Control "no-cache"