A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/API/ServiceWorkerRegistration/updateViaCache below:

ServiceWorkerRegistration.updateViaCache - Web API | MDN

ServiceWorkerRegistration.updateViaCache

Baseline Widely available

updateViaCache は ServiceWorkerRegistration インターフェイスの読み取り専用プロパティで、 ServiceWorkerContainer.register の呼び出しで指定されたモードを使用してキャッシュを更新します。 importScripts のリクエストは HTTP キャッシュで行われます。 updateViaCache はこの動作を制御します。

値

以下の値の何れかを返します。

例

次の例は、 updateViaCache の使用例です。

if ("serviceWorker" in navigator) {
  navigator.serviceWorker
    .register("/service-worker.js", {
      updateViaCache: "none",
    })
    .then((registration) => {
      registration.addEventListener("updatefound", () => {
        // If updatefound is fired, it means that there's
        // a new service worker being installed.
        console.log(`Value of updateViaCache: ${registration.updateViaCache}`);
      });
    })
    .catch((error) => {
      console.error(`Service worker registration failed: ${error}`);
    });
}
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4