chore(review): 1106 Service Worker·호스팅 조치 브랜치를 합친다

This commit is contained in:
DongHyeonka
2026-11-06 07:02:34 +09:00
5 changed files with 81 additions and 11 deletions
@@ -611,10 +611,11 @@ Service Worker를 별도 선택한 조합에서만 추가. 워커의 fetch 가
`skipWaiting()`하고, 활성화 때 `registration.unregister()`한다. fetch handler가
없어서 그동안의 요청은 모두 네트워크로 간다. 다음 load부터는 제어받지 않는다.
브라우저 확인: `tests/e2e/service-worker-recovery.spec.ts`.
- 이 경로가 동작하려면 `service-worker.js`를 `Cache-Control: no-cache`로 서빙해야
한다. 워커를 싣는 빌드(`ACTIVE`·`REMOVE_REGISTRATION`)에서는
`verify:hosting-headers` live 모드가 `/service-worker.js`를 요청해 이 헤더를
확인하고, 다르면 FAIL이다(`config/hosting/cache-policy.json` `serviceWorker`,
- 이 경로가 동작하려면 `service-worker.js`를 `Cache-Control: no-cache`로, redirect
없이 서빙해야 한다. 브라우저는 워커 스크립트의 redirect를 같은 origin 안이라도
거절한다. 워커를 싣는 빌드(`ACTIVE`·`REMOVE_REGISTRATION`)에서는
`verify:hosting-headers` live 모드가 `/service-worker.js`를 요청해 이 헤더와
redirect를 확인하고, 다르면 FAIL이다(`config/hosting/cache-policy.json` `serviceWorker`,
`scripts/verify-hosting-headers.ts`). fixture 모드는 선언끼리만 대조하므로
`UNVERIFIED`다. 하위 경로 base URL은 live probe가 아직 받지 않는다
(`scripts/lib/hosting-probe.ts` `classifyLiveHostingBaseUrl`, 리뷰 0929/13-06).
+6 -3
View File
@@ -71,9 +71,12 @@ It also requests `appRoute` (`/__probe/deep-link`, a path no build has a file
for): the host must answer 200 with the same `index.html` (the same entry
script) and the HTML headers, so a host without the SPA fallback fails
(review 1101/13-04). When the build ships a worker it requests
`/service-worker.js` and expects `no-cache`. The surfaces and their headers are
declared in `config/hosting/cache-policy.json`. For each cacheable extension the
release has under `assets/` (`.css`, `.js`, `.woff2` and the rest of
`/service-worker.js` and expects `no-cache` and no redirect at all, not even
one inside the origin: browsers fetch the worker script with redirect mode
`error`, so registration, every update check and the `REMOVE_REGISTRATION`
kill switch fail behind one (review 1106/06-01). The surfaces and their
headers are declared in `config/hosting/cache-policy.json`. For each cacheable
extension the release has under `assets/` (`.css`, `.js`, `.woff2` and the rest of
`CACHEABLE_ASSET_CONTENT_TYPES`) it requests the first such file and expects
exactly that type (`hashedAsset.css` and so on). The worker's install refuses
the whole release when one precached asset has another type, while a page