From 61e8b597dc30d19d2b2b359a58918b8e80ca3aa4 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Thu, 6 Aug 2026 13:09:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20harmonize=20cache=20co?= =?UTF-8?q?nfiguration=20for=20MediaPipe=20assets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wasm and js files shipped by MediaPipe were served with different cache policies, which could leave the two out of sync on the client (fresh js with stale wasm, or vice versa). Align the cache configuration across the MediaPipe assets so they are always cached and invalidated together. --- CHANGELOG.md | 1 + docker/dinum-frontend/nginx/default.conf | 5 +++++ src/frontend/default.conf | 5 +++++ src/helm/extra/templates/frontend_nginx_cm.yaml | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a78ea7ea..f4aafe86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ### Fixed - 🐛(frontend) serve MediaPipe assets under a versioned path +- 🐛(frontend) harmonize cache configuration for MediaPipe assets ## [1.25.1] - 2026-08-06 diff --git a/docker/dinum-frontend/nginx/default.conf b/docker/dinum-frontend/nginx/default.conf index 173f5b9f..c3d26ec6 100644 --- a/docker/dinum-frontend/nginx/default.conf +++ b/docker/dinum-frontend/nginx/default.conf @@ -65,6 +65,11 @@ server { sub_filter_once off; } + location ^~ /assets/mediapipe/wasm/ { + expires 30d; + add_header Cache-Control "public, max-age=2592000"; + } + # Serve static files with caching location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d; diff --git a/src/frontend/default.conf b/src/frontend/default.conf index c2e7ef7e..cf83d258 100644 --- a/src/frontend/default.conf +++ b/src/frontend/default.conf @@ -4,6 +4,11 @@ server { server_tokens off; root /usr/share/nginx/html; + + location ^~ /assets/mediapipe/wasm/ { + expires 30d; + add_header Cache-Control "public, max-age=2592000"; + } # Serve static files with caching location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { diff --git a/src/helm/extra/templates/frontend_nginx_cm.yaml b/src/helm/extra/templates/frontend_nginx_cm.yaml index fffddf3b..3c6ef2df 100644 --- a/src/helm/extra/templates/frontend_nginx_cm.yaml +++ b/src/helm/extra/templates/frontend_nginx_cm.yaml @@ -73,6 +73,11 @@ data: sub_filter_once off; } + location ^~ /assets/mediapipe/wasm/ { + expires 30d; + add_header Cache-Control "public, max-age=2592000"; + } + # Serve static files with caching location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d;