From 539ec718063f37bfeeb4c699737eebe19bf80b82 Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 17 Jun 2026 00:00:24 +0200 Subject: [PATCH] Prevent stale frontend assets in Docker --- CHANGELOG.md | 1 + backend/tests/test_docker_runtime_config.py | 2 ++ docs/CODEX_EXECUTION_LOG.md | 1 + frontend/nginx.conf | 10 ++++++++++ 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f6ca03..74102770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Added `POST /api/v1/analysis/change-detection` for synchronous comparison of two vector datasets in the same project. - Added a `ChangeDetectionService` that prefers persisted `vector_features`, falls back to stored GeoJSON with an explicit warning, and returns added/removed/unchanged GeoJSON features. - Added a frontend Change Detection panel and MapLibre change overlay styling for added, removed and unchanged geometries. +- Added nginx no-cache headers for frontend HTML/assets so LAN Docker rebuilds are visible without stale browser modules. - Added backend tests for persisted vector feature comparison and canonical API envelope behavior. - No migrations, live provider fetching, AI inference, new dependencies, LiDAR, Copilot, Training Studio or separate Reports module were introduced. diff --git a/backend/tests/test_docker_runtime_config.py b/backend/tests/test_docker_runtime_config.py index 251528fc..1716c007 100644 --- a/backend/tests/test_docker_runtime_config.py +++ b/backend/tests/test_docker_runtime_config.py @@ -78,6 +78,8 @@ def test_frontend_uses_same_origin_api_proxy_by_default() -> None: assert "location /api/" in nginx_config assert "proxy_pass http://backend:8000/api/" in nginx_config assert "location = /health" in nginx_config + assert 'add_header Cache-Control "no-cache"' in nginx_config + assert "location /assets/" in nginx_config assert "try_files $uri $uri/ /index.html" in nginx_config diff --git a/docs/CODEX_EXECUTION_LOG.md b/docs/CODEX_EXECUTION_LOG.md index 539f3acb..81f4f407 100644 --- a/docs/CODEX_EXECUTION_LOG.md +++ b/docs/CODEX_EXECUTION_LOG.md @@ -4,6 +4,7 @@ Changed: - Added `POST /api/v1/analysis/change-detection` for comparing two vector datasets in the same project through the existing synchronous job envelope. - Added `ChangeDetectionService` with persisted `vector_features` as the primary source of comparable geometries and explicit stored-GeoJSON fallback warnings for older datasets. - Added frontend Change Detection controls, summary counts and MapLibre overlay styling for `added`, `removed` and `unchanged` feature properties. +- Added nginx no-cache headers for frontend HTML/assets after browser verification exposed stale cached modules on the LAN deployment. - Added backend tests for persisted-vector comparison and canonical API envelope behavior. Limitations: diff --git a/frontend/nginx.conf b/frontend/nginx.conf index f87142f4..a599e822 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -5,6 +5,16 @@ server { root /usr/share/nginx/html; index index.html; + location = /index.html { + add_header Cache-Control "no-cache"; + try_files /index.html =404; + } + + location /assets/ { + add_header Cache-Control "no-cache"; + try_files $uri =404; + } + location /api/ { proxy_pass http://backend:8000/api/; proxy_http_version 1.1;