Summary#
브라우저는 BFCache처럼 힙은 보존하고 연결만 끊는 식으로 동작할 수 있고, 보안 완화는 정상 렌더링 경로를 쉽게 망가뜨릴 수 있다. 권장 접근은 탐지/표시/백엔드 상태를 느슨하게 결합하고, pagehide 같은 실제 이벤트에서 명시적으로 리셋하며, 보안 차단이 필요한 경로와 정상 미리보기 경로를 분리하는 것이다.
Problem#
확장 패널 생성, 포트 연결, 미리보기 렌더링 같은 기능이 브라우저의 실제 lifecycle과 어긋나면 stale state, race, broken preview가 발생한다. 특히 '차단하면 안전하다'는 식의 보안 패치는 정상 사용 경로를 함께 손상시키기 쉽다.
Solution#
UI 컨테이너는 조기에 안정적으로 만들고 내부 내용만 대상 상태에 따라 바꾸며, pagehide/BFCache 복귀 시 백엔드 연결 상태를 재초기화한다. 파일 미리보기는 다운로드 차단 정책과 분리해, 위험한 실행 표면은 막되 안전한 렌더링 표면은 유지하도록 경로별 정책을 설계한다.
Failure Modes#
- unload만 믿고 정리 로직을 짜서 BFCache 복귀 후 죽은 포트와 살아 있는 상태가 공존함
- 탐지 이후에만 UI를 생성해 브라우저 API 제약 때문에 패널을 제대로 관리하지 못함
- 보안 헤더를 일괄 강화해 SVG 같은 정상 미리보기까지 전부 깨뜨림
Sources#
- https://github.com/Comfy-Org/ComfyUI/pull/15167
- https://github.com/Comfy-Org/ComfyUI/pull/15165
- https://github.com/Comfy-Org/ComfyUI/pull/15154
- https://github.com/Comfy-Org/ComfyUI/pull/15155
- https://github.com/Comfy-Org/ComfyUI/pull/15161
- https://github.com/Comfy-Org/ComfyUI/pull/14681
- https://github.com/Comfy-Org/ComfyUI/pull/15149
- https://github.com/GitHubDaily/GitHubDaily/pull/267
- https://github.com/GitHubDaily/GitHubDaily/pull/52
- https://github.com/fastapi/full-stack-fastapi-template/pull/2394
- https://github.com/fastapi/full-stack-fastapi-template/pull/2393
- https://github.com/fastapi/full-stack-fastapi-template/pull/2392
- https://github.com/fastapi/full-stack-fastapi-template/pull/2389
- https://github.com/fastapi/full-stack-fastapi-template/pull/2386
- https://github.com/fastapi/full-stack-fastapi-template/pull/2382
- https://github.com/fastapi/full-stack-fastapi-template/pull/2380
- https://github.com/fastapi/full-stack-fastapi-template/pull/2373
- https://github.com/fastapi/full-stack-fastapi-template/pull/2379
- https://github.com/react/react/pull/37152
- https://github.com/react/react/pull/37151
- https://github.com/react/react/pull/37155
- https://github.com/react/react/pull/37143
- https://github.com/react/react/pull/37144
- https://github.com/react/react/pull/37125
- https://github.com/react/react/pull/37135
- https://github.com/react/react/pull/36986
- https://github.com/thedaviddias/Front-End-Checklist/pull/664
- https://github.com/thedaviddias/Front-End-Checklist/pull/680
- mined_at: 2026-07-31T03:25:15Z
Sagwan Revalidation 2026-07-31T04:05:31Z#
- verdict:
ok - note: BFCache/pagehide와 경로별 보안 완화 권장은 현재도 유효하다.