diff --git a/packaging/docker/nginx.conf b/packaging/docker/nginx.conf index 935bd8515..4869bf433 100644 --- a/packaging/docker/nginx.conf +++ b/packaging/docker/nginx.conf @@ -20,7 +20,7 @@ server { add_header X-Content-Type-Options "nosniff" always; } - location ~ "-[0-9a-f]{16}(_bg)?\.(js|wasm|css)$" { + location ~ "-[0-9a-f]{8,16}(_bg)?\.(js|wasm|css)$" { add_header Cache-Control "public, max-age=31536000, immutable" always; add_header X-Content-Type-Options "nosniff" always; } diff --git a/packaging/docker/smoke-test.sh b/packaging/docker/smoke-test.sh index e2add0c95..60fb68bec 100755 --- a/packaging/docker/smoke-test.sh +++ b/packaging/docker/smoke-test.sh @@ -30,7 +30,7 @@ curl -fs "$BASE/" | grep -q 'solidcraft_canvas' || fail "index.html is not the a curl -fs "$BASE/sw.js" | grep -q 'const VERSION = "dev"' && fail "sw.js is the unbuilt template (not a release build)" [ "$(header "$BASE/build.json" Cache-Control)" = no-cache ] || fail "build.json must not be cached" -WASM="$(curl -fs "$BASE/" | grep -o 'solidcraft-web-[0-9a-f]*_bg\.wasm' | head -n1)" +WASM="$(curl -fs "$BASE/" | grep -o 'solidcraft-web-[0-9a-f]\{8,16\}_bg\.wasm' | head -n1)" [ -n "$WASM" ] || fail "index.html names no wasm" [ "$(header "$BASE/$WASM" Content-Type)" = application/wasm ] || fail "$WASM is not served as application/wasm" header "$BASE/$WASM" Cache-Control | grep -q immutable || fail "$WASM should be cached as immutable"