SDK caching principles
How the SDK caches content. You can control the cache size sings controls described here.
Related reading: SDK and app size.
Principles
App size vs cache
Caching doesn't meaningfully change the app’s download or install size. It does increase on-device storage usage at runtime. In this regard, consider as follow
Where cached data lives
Cached media is stored in OS cache locations (cache or temporary directories). The OS can purge it under storage pressure, and the SDK will refill it as needed.
Purpose of caching
Caching reduces loading time by keeping the next likely assets available, including thumbnails, upcoming pages or items, and video startup bytes.
Default behavior
-
Prefetch level
The SDK uses the default prefetch policy. -
Cache size
The SDK uses a platform default cache budget ifcachingSizeisnil. This is typically about 500Mb. -
Runtime behavior
The SDK automatically prefetches and caches around viewer navigation and playback to improve perceived performance.
What gets prefetched
-
Prepared content (optional warm-up)
Content lists for faster entry. -
Images
Thumbnail and poster URLs. -
Stories
Upcoming pages. -
Moments and Videos
Upcoming items. For Videos, startup bytes are prefetched to improve time to first frame. The SDK doesn't cache the entire video; instead, it caches a small segment to allow immediate playback.
How to adjust caching
You can adjust the cache by making the calls to the SDK:
- Cache size (MB) —
cachingSize
Updated 25 days ago
