v4.0.8: nginx no-cache·deck-favorites shim으로 배포/캐시 문제 수정

구 HTML·CDN immutable JS가 init 없이 남던 문제를 nginx 캐시 정책·shim·배포 검증으로 해결한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-23 16:24:19 +09:00
parent 72d73a54bd
commit eb4b35bccc
8 changed files with 100 additions and 20 deletions

View File

@@ -23,6 +23,23 @@ server {
client_max_body_size 25m;
}
# HTML — 배포 직후 반영
location ~* \.html$ {
add_header Cache-Control "no-cache, must-revalidate";
try_files $uri =404;
}
# 핵심 JS — 구 URL(?v= 없음)도 최신 파일 제공 (CDN immutable 회피)
location = /script/deck-favorites.js {
add_header Cache-Control "no-cache, must-revalidate";
try_files $uri =404;
}
location = /script/api.js {
add_header Cache-Control "no-cache, must-revalidate";
try_files $uri =404;
}
# CSS — 배포 후 즉시 반영 (immutable 사용 안 함)
location ~* \.css$ {
expires 1h;
@@ -30,8 +47,15 @@ server {
try_files $uri =404;
}
# 기타 정적 자산
location ~* \.(js|png|jpg|jpeg|gif|webp|ico|svg|woff2?)$ {
# JS — immutable 제거 (이미지보다 짧게 재검증)
location ~* \.js$ {
expires 1h;
add_header Cache-Control "public, must-revalidate";
try_files $uri =404;
}
# 이미지 등
location ~* \.(png|jpg|jpeg|gif|webp|ico|svg|woff2?)$ {
expires 7d;
add_header Cache-Control "public, immutable";
try_files $uri =404;