Skip to content

Offline Cache

The Offline Cache element is an invisible element that enables offline data caching using localStorage. It allows your web application to store and retrieve data locally so users can continue working without a network connection.


Overview

Offline Cache runs in the background with no visible UI. It intercepts data from target elements and caches it in the browser's localStorage. When the network is unavailable, cached data is served automatically.

Common uses:

  • Offline-capable forms and surveys
  • Caching API responses for faster load times
  • Ensuring data availability in low-connectivity environments

Adding an Offline Cache

  1. Open the Website Builder
  2. Find Offline Cache in the Elements panel (under Tools)
  3. Drag it onto your page (it will not be visible at runtime)
  4. Configure caching rules in the General Tab

Note: This element is available for web applications only.


Properties

General Tab

Caching Strategy

StrategyDescription
Cache FirstServe from cache if available; fetch from network only on cache miss
Network FirstFetch from network first; fall back to cache if offline
Stale While RevalidateServe from cache immediately, then update cache from network in the background

Target Elements

PropertyDescription
Target Element IDsComma-separated list of element IDs whose data should be cached

Cache Limits

PropertyDescriptionDefault
Max Age (seconds)How long cached data remains valid3600
Max ItemsMaximum number of cached entries before oldest are evicted100

Online / Offline Indicator

PropertyDescriptionDefault
Show IndicatorDisplay a small badge showing online/offline statusOff
Indicator PositionWhere the status badge appears (top-left, top-right, bottom-left, bottom-right)top-right

Best Practices

  1. Choose the right strategy - Use Cache First for mostly-static data; Network First for frequently updated data

  2. Set reasonable max age - Avoid serving very stale data by tuning the expiration

  3. Limit cached items - Keep Max Items low to avoid excessive localStorage usage

  4. Combine with JSON Data Source - Cache API responses from a JSON Data Source element for offline access


Questions?

If you have any questions, please don't hesitate to contact us. Alternatively, you can submit an issue on this platform.

Useful Links:

Web Elements - https://help.acenji.com/#/./create-web-application/elements/index

Was this article helpful?

No-Code App Builder