Skip to content

Local Cache

Overview

When the SDK cannot upload data immediately, requests are cached locally and uploaded automatically when connectivity is available.

In v1.0.1, this is handled by DataCacheSystem + DualFileCache with retry backoff.

Cache size

Default max cache size is 100 MB.

Cache location

The cache is stored in the app Documents directory using two files:

  • data_read
  • data_write

Upload behavior

  • Cached content is retried automatically.
  • Retry timing uses exponential backoff (up to 5 minutes between retries).
  • Cache survives across app launches/sessions.
  • Cached content is removed after successful upload.

Exponential retry backoff

The retry delay starts at 10 seconds and increases after consecutive failures:

  • 10s -> 20s -> 40s -> 80s -> 160s -> 300s (cap)

After a successful upload, the delay resets back to 10 seconds.

Why this exists:

  • prevents repeated rapid retries during outages
  • reduces battery/network overhead when connectivity is unstable
  • keeps collecting data locally while waiting for a good upload window

Fallback behavior

If file cache initialization fails, the SDK uses an in-memory fallback cache for the current run.

intercom If you have a question or any feedback about our documentation please use the Intercom button (purple circle) in the lower right corner of any web page or join our Discord.