All Products
Search
Document Center

Observe the behavior of offline packages from the HTTP level (4): fallback

Last Updated: Mar 10, 2021

In some cases, for example, the local signature verification for offline packages failed, the H5 container fails to locally obtain the required resources. The client will instead obtain the resources from online addresses. The basic process is as follows:

  1. The client sends a request to the MDS server with IDs and local version numbers of all H5 apps that have been locally installed.
  2. If the offline package exists, the server returns related information.
  3. The client takes the initiative to download the amr file of the offline package based on the Package URL and Download configuration parameters in the returned information.
  4. If the H5 container fails to locally obtain the offline package resources for some reason, the client needs to use the fallback base URL in the returned information. The container can use this URL to visit the online CDN for loading the H5 application resources, such as HTML, Javascript, and CSS files, but not amr files.

Procedures

  1. The client obtained the offline package information and downloaded the amr file.
    The amr file is downloaded

  2. The client downloads H5 application resources from the fallback address.
    Download H5 application resources

Example of fallback mode log: 3-offline-package-fallback-example.chls.zip