til/applied-sciences/engineering/why-a-dead-site-still-loads
why-a-dead-site-still-loads.mdupdated 2026-07-162473 words
ダブルクリックで英日反転
Applied Sciences · Engineering

Why a Dead-DNS Site Still Opens in Your Browser

EN

If a site's DNS is gone yet it still renders in Chrome on one machine, two mechanisms are to blame: the Service Worker's offline cache and a surviving SPA tab — not a network glitch.

HTTP Cache vs. Service Worker

  • HTTP cache is revalidated on F5 reload — if DNS is dead it should fail.
  • A Service Worker intercepts every fetch and can serve from Cache Storage with zero network access.
  • Even with dead DNS, the SW returns the last stored version of the site.

Why PWAs Enable This

  • PWAs register a Service Worker + manifest to work offline like a native app.
  • Tools like vite-plugin-pwa / Workbox cache the whole site on first visit.
  • SW is often only active in production, making the behaviour invisible in dev.

SPAs and Surviving Tabs

  • A SPA loads HTML once; JS handles all navigation inside the same tab.
  • If the tab stays open after DNS dies, the page remains in memory and continues to display.

Diagnosing with Incognito

  • Incognito starts with no SW, no HTTP cache, no cookies — a clean slate.
  • Dead DNS + SW present → normal window shows, incognito cannot connect.
  • Unregister via DevTools → Application → Service Workers → Unregister to force-clear.
"Only I can see it" ≠ "the site is up" — always verify in an incognito window.
応用科学 · エンジニアリング

DNSが​死んでいるのに​サイトが​自分だけ​見えるのは​なぜか

JP

DNSが​消えたはずの​サイトが​特定PCの​Chromeだけで​表示され続ける​場合、​犯人は​Service Worker​(=ブラウザ内に​常駐する​小さな​JSプログラム)の​オフラインキャッシュか、​生き残った​SPAタブの​どちらかだ。

HTTPキャッシュと​Service Workerの​違い

  • HTTPキャッシュは​F5​(再読み込み)​時に​サーバーへの​再検証を​試みる​=DNS死亡時は​エラーに​なるはず。
  • Service Workerは​すべての​fetchを​インターセプトしCache Storageから​直接応答できる。
  • DNSが​死んでいても、​SWが​生きていれば​最後に​保存した​バージ​ョンが​表示される。

PWAが​この​現象を​起こす理由

  • PWA​(=インストール可能・オフライン動作対応の​Webアプリ)は​Service Workerと​Manifestで​構成される。
  • vite-plugin-pwaや​Workbox​(Googleの​SWライブラリ群)が​初回訪問時に​サイト全体を​キャッシュする。
  • SWは​本番環境のみ​有効化される​設定が​多く、​開発中は​気づきにくい。

SPAと​生き​残りタブ

  • SPA​(=Single Page Application・​最初の​1回だけHTMLを​読み込みJSで​画面を​切り​替える​アプリ)は​タブを​閉じるまで​メモリに​残る。
  • DNS消滅後も​タブを​開いたままに​していると​表示が​維持される。

シークレットウィンドウで​原因を​特定する

  • シークレット​(プライベート)​ウィンドウは​SW・HTTPキャッシュ・Cookieが​すべて​ゼロの​「まっさらな​ブラウザ」。
  • 通常ウィンドウで​見える​・シークレットで​繋がらない​ → キャッシュ/SWの​仕業と​確定。
  • 強制削除は​DevTools → Application → Service Workers → Unregisterで​行う。
「自分だけ​見える」≠​「サイトが​生きている」​——まずシークレットウィンドウで​確認する。
148 notestil