Kontentsu ni tsugi kudasai

デルタアップデート

Capgoのライブアップデートシステムは、変更されたファイルのみを送信することで、JSバンドルの全体を送信するのではなく、更新をより速く効率的に提供できます。

特に、遅いまたはメートルネットワーク接続のユーザーにとっては、ダウンロードする必要があるデータの量を最小限に抑えることで、特別に有益です。

A second benefit is when the app has large assets that change rarely, like images or videos, compared to zipped JS files, it will be downloaded only once.

How Delta (Manifest) Updates Work

How Delta (Manifest) Updates Work

Delta (manifest) updates in Capgo are handled by the Capgo plugin installed in your app. When you upload a new version of your app using the --delta flag, Capgo does the following:

  1. Each file in your build is uploaded individually.
  2. Checksums are generated for each file.
  3. A new JSON manifest is created, listing all files and their checksums.
  4. This manifest is uploaded to the Capgo database

When a device running your app checks for an update, the Capgo plugin receives the new manifest from the server. It compares this manifest to the one it currently has, identifying which files have changed based on the checksums and file paths.

The plugin then downloads only the changed files, rather than the entire JS bundle. It reconstructs the new version of the app by combining these downloaded files with the unchanged files it already has.

Delta (マニフェスト) の更新を有効にする

「Delta (マニフェスト) の更新を有効にする」のセクション

Capgo アプリのために、Delta (マニフェスト) の更新を有効にするには、単に次の旗を使用して新しいバージョンをアップロードしてください: --delta ターミナル画面

クリップボードにコピー
npx @capgo/cli@latest bundle upload --delta

__CAPGO_KEEP_0__がインスタント アプリケーション モード ( autoUpdate 、または"atInstall", "onLaunch")に設定されている場合、 "always"capacitor.config、CLIはそれを検出します。非対話型環境では、Delta(マニフェスト)アップデートを自動的に送信し、対話型環境ではアップロードする前に確認を求めるようになります。LEGACY directUpdate configはまだ検出されます。使用 --no-delta を強制的にフルバンドルアップロードするには

Deltaアップデートの制限事項

セクション:Deltaアップデートの制限事項
  • 空のファイル: CLIはログ Ignoring empty file... ゼロバイトファイルをDeltaマニフェストから除外します。アップロードを中断せずに、結果のバンドルを変更する可能性があるため、ゼロバイトファイルをDeltaバンドルパスに含めないでください。
  • パスのスペース: Deltaアップロードは、バンドルパスにスペースが含まれている場合にアップロードする前に失敗します。スペースを削除するためにファイルまたはディレクトリを再度名付けましょう。

Delta(マニフェスト)アップデートの強制

セクション:Delta(マニフェスト)アップデートの強制

If you want to ensure that all uploads are Delta (manifest) updates and prevent any accidental full bundle uploads, you can use the --delta-only flag:

Terminal window
npx @capgo/cli@latest bundle upload --delta-only

When --delta-only is used, Capgo will only upload individual files and generate a manifest. Any device that does not support Delta (manifest) updates will not be able to download the update.

You might want to use --delta-only if:

  • You always want to use Delta (manifest) updates and never want to allow full bundle uploads
  • You’re setting up a CI/CD pipeline and want to ensure all automated uploads are Delta (manifest)
  • Your app is large and bandwidth is constrained, so you need to minimize upload/download sizes

If you need to do a full bundle upload while --delta-only は設定されている場合、単にアップロードコマンドを実行してください。 --delta-onlyは、1回のアップロードにのみ設定を上書きすることを許可し、必要に応じて完全なバンドルをプッシュできます。

トラブルシューティング

トラブルシューティング

Delta (マニフェスト) のアップデートが機能しないように見えますか (例: デバイスは常に小さな変更にも対処するためにフル JS バンドルをダウンロードしています)。

  • が使用されていることを確認してください。 --delta が指定されている場合、毎回新しいバージョンをアップロードするたびにを指定してください。
  • が使用されている場合、を指定してください。 --delta-onlyが指定されていないことを確認してください。 --delta が指定されていないことを確認してください。
  • Your device is running the latest version of the Capgo plugin
  • Your device has a stable network connection and can reach the Capgo servers

アップロードの詳細を確認するには、Capgoのウェブアプリを使用することもできます。

  1. 以下の手順に従ってください。 ウェブアプリ
  2. アプリをクリックします。
  3. 統計バーのバンドル数をクリックします。
  4. 最後のバンドルを選択します。
  5. 以下のフィールドを確認します。 Partial バンドルタイプ 問題が続きます場合は、__CAPGO_KEEP_0__のサポートに連絡してください。サーバーログを確認して、デリタ(マニフェスト)のアップロードが正しく処理されているか、デバイスが更新されたマニフェストを受信しているかを確認できます。

以上です!フラグは、Capgoにデリタ(マニフェスト)のアップロードとマニフェストの生成が必要な個々のファイルアップロードを実行するように指示します。

That's it! The --delta flag tells Capgo to perform the individual file uploads and manifest generation needed for Delta (manifest) updates.

Capgoを使用するには、Cloudflareのキャッシュを無効にする必要があります。 --delta 毎回、Delta (マニフェスト) アップデートとして配信したい新しいバージョンをアップロードするたびに。フラグを省略すると、Capgo は、すべての JS バンドルを 1 つのファイルとしてアップロードし、デバイスは、変更されたのは小さな部分だけでも、全バンドルをダウンロードすることになる。

Deltaアップデートから続けてください

Deltaアップデートから続けて

Capgoを使用している場合、ライブアップデートは自動的に有効になります。 Deltaアップデート ライブアップデートの配信計画を立てるには、それを接続する Capgo ライブアップデート for the product workflow in Capgo Live Updates, ライブアップデートの差分 概要の実装詳細について 機能 Capgoの機能詳細の実装について アップデートの動作 アップデートの動作についての実装詳細、そして アップデートの種類 アップデートの種類についての実装詳細。