fix: 데스크톱 캐시로 인한 최신 화면 미반영 해결 + HTML no-cache
CI / build (push) Failing after 13m13s

- electron/main.cjs: 시작 시 HTTP 캐시 클리어 → 라이브 사이트 최신 프론트 항상 로드
  (루트 '/' HTML 이 캐시돼 옛 번들이 뜨던 문제 — '로그인 전 사이드바' 미반영 원인)
- nginx: location / 에 Cache-Control no-cache 추가(웹/PWA 진입 HTML 항상 최신)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-07 17:25:21 +09:00
parent 0f9f7b4507
commit dc31cf4bfa
2 changed files with 12 additions and 2 deletions
+9 -2
View File
@@ -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()