The network is the weakest link

Most mobile time is spent on networks that are good until they are not — a subway car, a stadium, a rural road, a roaming border. For a broker checking a position, a rider accepting an order, or a clerk scanning a ticket, the moment the signal drops is exactly when the screen needs to keep working. Two models on the same phone handle that moment very differently.

H5 can hope to survive offline. A mini-program is built to.

H5 offline is a negotiation with the browser

An H5 page is network-bound by default. To work offline it must register a service worker — and that is the catch. Service workers only run over HTTPS (or localhost), have a multi-step lifecycle (register, install, activate, fetch), and require the developer to hand-author caching strategy with the Cache API and durable data with IndexedDB. If registration fails, the scope is wrong, the update is stuck, or the browser does not support it, the page simply dies the moment the connection does. Many H5 pages never implement it at all, so they are offline-dead by omission.

Even when a service worker is present, it is a separate background thread with its own state and failure modes. A stuck activation or a cache that never refreshes is invisible until the user is already staring at a blank screen.

Mini-programs treat offline as a primitive

A mini-program does not bolt on offline as an afterthought. The program package — framework, shell, and first screen — is already on the device from a previous launch, and local storage gives the program a durable, synchronous-ish place to keep user data and frequently used content. When the signal drops, the app shell renders from cache, cached data is shown instantly, and only the live requests wait and retry. The flow degrades gracefully instead of collapsing.

This is why the same transactional flow behaves so differently: H5 reaches for the network first and the cache second (if it bothered to set one up); a mini-program paints from what is already on the device and treats the network as the optional part.

Where the resilience actually comes from

  • Pre-cached package. The shell and first screen are local; the UI opens without a network round trip.
  • Local data store. User state, recent quotes, and form drafts survive a drop and reappear on reopen.
  • Designed-in degradation. The runtime paints the cached view and queues live calls; H5 must hand-code all of this on a fragile background thread.
  • Predictable on weak networks. Because the heavy assets are already local, only small data requests are exposed to the flaky link.

Side by side

DimensionH5 / PWAMini-Program
Offline mechanismService worker + Cache API + IndexedDBPre-cached package + local storage
ActivationSeparate thread, multi-step lifecycle, can fail silentlyBuilt into the runtime, on by default
Works with no HTTPS?No — service worker requires HTTPSYes — local assets need no transport
Behavior on dropBlank if SW missing/broken; cached if presentApp shell + cached data render; live calls retry
Developer burdenHand-authored caching strategy + update handlingDeclarative package + storage APIs
Weak-network exposureEntire page re-fetchedOnly small live data requests

What this means for your flow

For any flow that happens in the real world — not just on a desk next to Wi-Fi — offline resilience is a feature, not a bonus. A quote that opens from cache, a form that keeps the draft, a ticket that still scans, are the difference between a completed action and a dead screen. H5 can reach the same place, but only by hand-building and maintaining a stateful background worker that most pages never ship.

Where Cross Mini App fits

Cross Mini App is the runtime and the open catalog for the offline-by-design model. A mini-program built once against the standard API surface runs inside any host with its package pre-cached and its local store intact, so the screen opens and the data is there even when the link is not. The network becomes the optional layer, not the foundation. H5 stays the door; the mini-program is the room that does not go dark when the lights flicker.

Sources