Offline Mode
The app is stored in the browser cache as long as the internet is available. If the internet becomes unavailable, the Service Worker of the PWA serves the cached app from the browser cache. This allows the app to be opened even if cloud or on-premises services are not reachable.
This also applies to documents, provided users have been explicitly granted permission. Documents can be marked as available offline and will then be readable in the app even when the device has no internet connection. Entire folders and files can also be made available offline. In this case, the offline flag is set for all included documents. The marked documents are then stored within the IndexedDB in the browser app. The browser ensures that only the app can access this storage area.
When a document is opened in offline mode, no end-to-end encrypted connection can be established with the on-premise system. Therefore, the cached document must be encrypted in such a way that it can be decrypted in offline mode. For this purpose, the symmetric document key is encrypted directly with the device’s secret key (and not with the session key of the end-to-end encrypted connection). When the cached document is opened, the secret key from the key management can be used to decrypt the offline document.
The offline metadata (such as file name, folder name, register name, and title) is stored unencrypted on the device.
The app can use all available free storage on the device, but iOS displays a warning after 1GB and then every 0.4GB:
Even when the internet is available, marked documents can be opened much faster, as they are already stored encrypted on the device and do not need to be downloaded again. The app automatically detects if a document in STP.Documents.OnPremise has a newer version than on the device and caches the newer version when opened. This ensures documents are always quickly available, regardless of internet connectivity. Users can remove the available offline flag at any time, and the documents stored in the app will then be deleted, so they must be reloaded from STP.Documents.OnPremise when accessed again.