From dc31cf4bfa3adbec9d2ed36196042a9827380714 Mon Sep 17 00:00:00 2001 From: ByungCheol Date: Sun, 7 Jun 2026 17:25:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8D=B0=EC=8A=A4=ED=81=AC=ED=86=B1=20?= =?UTF-8?q?=EC=BA=90=EC=8B=9C=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=B5=9C?= =?UTF-8?q?=EC=8B=A0=20=ED=99=94=EB=A9=B4=20=EB=AF=B8=EB=B0=98=EC=98=81=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20+=20HTML=20no-cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - electron/main.cjs: 시작 시 HTTP 캐시 클리어 → 라이브 사이트 최신 프론트 항상 로드 (루트 '/' HTML 이 캐시돼 옛 번들이 뜨던 문제 — '로그인 전 사이드바' 미반영 원인) - nginx: location / 에 Cache-Control no-cache 추가(웹/PWA 진입 HTML 항상 최신) Co-Authored-By: Claude Opus 4.8 --- deploy/nginx-sb-front.conf | 3 +++ electron/main.cjs | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/deploy/nginx-sb-front.conf b/deploy/nginx-sb-front.conf index 0f3cd01..4e00b0c 100644 --- a/deploy/nginx-sb-front.conf +++ b/deploy/nginx-sb-front.conf @@ -7,8 +7,11 @@ server { index index.html; # SPA: 새로고침/직접 진입 시 index.html 로 폴백 (vue-router history 모드) + # 진입 HTML(루트·폴백)은 캐시 금지 — 배포로 청크 해시가 바뀌어도 항상 최신 진입점을 받도록. + # (루트 '/' 는 아래 '= /index.html' 매칭을 안 타므로 여기에 헤더를 둬야 함) location / { try_files $uri $uri/ /index.html; + add_header Cache-Control "no-cache"; } # index.html 은 캐시 금지 — 배포로 청크 해시가 바뀌어도 항상 최신 진입점을 받도록. diff --git a/electron/main.cjs b/electron/main.cjs index e4691e6..c29c697 100644 --- a/electron/main.cjs +++ b/electron/main.cjs @@ -1,7 +1,7 @@ // Slim Budget 데스크톱(Electron) 메인 프로세스. // 라이브 사이트(https://app.sblog.kr)를 직접 로드한다 → 프론트 변경이 자동 반영(재설치 불필요), // 같은 출처라 CORS 우회도 불필요. 배포된 웹 게이트가 Electron 을 감지해 안내페이지 대신 전체 앱을 띄운다. -const { app, BrowserWindow, shell } = require('electron') +const { app, BrowserWindow, shell, session } = require('electron') const fs = require('fs') const path = require('path') @@ -81,7 +81,14 @@ function createWindow() { }) } -app.whenReady().then(() => { +app.whenReady().then(async () => { + // 시작 시 HTTP 캐시 비움 → 라이브 사이트의 최신 프론트를 항상 로드(옛 HTML 캐시로 인한 미반영 방지). + // localStorage(로그인 세션)는 캐시가 아니라 영향 없음. + try { + await session.defaultSession.clearCache() + } catch { + /* 캐시 클리어 실패 무시 */ + } createWindow() app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) createWindow()