fix(web): blank-screen hardening — stale chunk recovery, error boundary, no-cache index.html

- main.tsx: on vite:preloadError (stale index.html referencing removed
  hashed chunks after a redeploy) reload the page immediately.
- New ErrorBoundary around the whole router: render errors show a Persian
  fallback with «تلاش مجدد» instead of wiping the DOM.
- nginx: index.html served with Cache-Control no-cache,no-store,
  must-revalidate (verified live); /assets/* stays public, immutable.
This commit is contained in:
2026-09-06 19:03:27 +03:30
parent 4dd60d7cd9
commit 1f123a0a05
4 changed files with 67 additions and 3 deletions
+8 -1
View File
@@ -34,7 +34,14 @@ server {
try_files $uri $uri/ /index.html;
}
# Static assets cache
# index.html itself must never be cached: after a redeploy the hashed
# /assets/* names change, and a stale cached HTML would 404 on the old
# chunks (blank page). Content-hashed assets below stay immutable.
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Static assets cache — hashed filenames are content-addressed
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";