---
title: "Offline tools"
description: "These features are considered experimental and are subject to breaking changes outside of the normal release cycle."
url: https://developers.dhis2.org/docs/app-runtime/advanced/offline/
source: https://github.com/dhis2/app-runtime/tree/master/docs/advanced/offline/README.md
---

# Offline tools

:::warning Experimental
These features are considered **experimental** and are **subject to breaking changes outside of the normal release cycle.**
:::

The app platform provides some support for PWA features, including a `manifest.json` file for installability and service worker which can provide offline caching. In addition to those features, the app runtime provides support for ["cacheable sections"](https://developers.dhis2.org/docs/app-runtime/advanced/offline/CacheableSections.md), which are sections of an app that can be individually cached on-demand. The [`useCacheableSection` hook](https://developers.dhis2.org/docs/app-runtime/advanced/offline/CacheableSections.md#usecacheablesection-api) and the [`CacheableSection` component](https://developers.dhis2.org/docs/app-runtime/advanced/offline/CacheableSections.md#cacheablesection-api) provide the controls for the section and the wrapper for the section, respectively. The [`useCachedSections` hook](https://developers.dhis2.org/docs/app-runtime/advanced/offline/CacheableSections.md#usecachedsections-api) returns a list of sections that are stored in the cache and a function that can delete them.

An important tool for offline-capable apps is the [`useDhis2ConnectionStatus` hook](https://developers.dhis2.org/docs/app-runtime/advanced/offline/useDhis2ConnectionStatus.md), which can be used to determine whether or not the app can connect to the DHIS2 server. There is also a [`useOnlineStatus` hook](https://developers.dhis2.org/docs/app-runtime/advanced/offline/useOnlineStatus.md) which returns whether or not the client is connected to the internet, but `useDhis2ConnectionStatus` is probably the one you want to use. On instances where DHIS2 is deployed locally in an environment without internet, `useOnlineStatus` can cause problems, because it will always return `false` even though the app can communicate with the DHIS2 server and therefore function just fine. `useDhis2ConnectionStatus` was created to address this problem.

## Examples

To see some examples of the APIs in use, see the [PWA example app](https://github.com/dhis2/app-platform/tree/master/examples/pwa-app/src/components/) in the platform repository.
