Self-heal a stale cached bundle via a build version
Phones kept running old JS because their cached index.html pointed at an old hashed asset. Both images now bake the commit SHA as BUILD_VERSION; the backend exposes it at GET /api/version and the client reloads once with a cache-busting query when its own baked version differs. Guarded by sessionStorage so it cannot loop. /api/version is unauthenticated like /api/health.
This commit is contained in:
1 parent
7ad14449ce
commit
7b97f010c9
11 files changed
+80
-4
No files matched your search
+8
-2
@@ -2,7 +2,10 @@ name: crypto_trading
|
||||
|
||||
services:
|
||||
backend:
|
||||
build: ./backend
|
||||
build:
|
||||
context: ./backend
|
||||
args:
|
||||
BUILD_VERSION: ${CRYPTO_BUILD_VERSION:-unknown}
|
||||
image: crypto_trading-backend
|
||||
container_name: crypto-trading-backend
|
||||
restart: unless-stopped
|
||||
@@ -56,7 +59,10 @@ services:
|
||||
- internal
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
build:
|
||||
context: ./frontend
|
||||
args:
|
||||
BUILD_VERSION: ${CRYPTO_BUILD_VERSION:-unknown}
|
||||
image: crypto_trading-frontend
|
||||
container_name: crypto-trading-frontend
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in new issue
Block a user