Skip to content

Delta Updates

Live updates can be significantly smaller and faster if only modified files are downloaded. For this, each bundle requires a manifest file. This is a simple JSON file containing information such as hashes about the files in a bundle. When performing a live update, the manifest of the new bundle is compared with the manifest of the current bundle, and only the changed files are downloaded.

Generate the manifest file

To generate a manifest file, run the manifests:generate command using the Capawesome CLI:

npx capawesome manifests:generate --path www

The path option is mandatory and specifies the path to the folder that contains the compiled web assets of your web app (e.g. www or dist). Make sure that the manifest file is regenerated after each build of your web app but before copying the files to the native projects:

npm run build
npx capawesome manifests:generate --path www
npx cap copy

The easiest way to achieve this is to include the command directly in your build script:

{
  "scripts": {
    "build": "ng build && npx capawesome manifests:generate --path www"
  }
}

Once the command has been executed, a capawesome-live-update-manifest.json file is created in the specified folder.

Warning

Delta updates can only be performed if two manifest files are available for comparison. If one manifest file is missing, then all files of the bundle must be downloaded, which makes the update process significantly slower. Therefore, make sure that the manifest file is always included in native updates.

Create a bundle

To create a bundle in Capawesome Cloud that supports delta updates, run the apps:bundles:create command using the Capawesome CLI:

npx capawesome apps:bundles:create --artifact-type manifest

It is important that the --artifact-type option is set to manifest so that the files of the bundle are uploaded individually and not as a zip archive.