When the H5 container cannot load offline package resources locally, it falls back to fetching them from an online CDN.
If the H5 container cannot obtain required resources locally, for example, because local signature verification of an offline package fails, the client falls back to fetching resources from online addresses. The basic process is as follows:
-
The client sends a request to the MDS server with IDs and local version numbers of all H5 apps that have been locally installed.
-
If the offline package exists, the server returns related information.
-
The client takes the initiative to download the amr file of the offline package based on the
Package URLandDownload configuration parametersin the returned information. -
If the H5 container fails to locally obtain the offline package resources for some reason, the client needs to use the
fallback base URLin 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
-
The client obtained the offline package information and downloaded the amr file.

-
The client downloads H5 application resources from the fallback address.

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