This feature is still in our final beta round. If you’d like to get access to it as a beta tester, please send us an email at offlinemode@despia.com
Local CDN uses native OS background transfer APIs (NSURLSession on iOS, WorkManager on Android) with built-in retry. Start a download, close the app, get notified when ready.
Installation
API Reference
Write
Download and cache a remote file. Fire-and-forget - do not await.- Basic
- With Push
string
required
Remote file URL to download
string
required
Local path:
folder/subfolder/filenamestring
required
Unique ID for this file
boolean
Set to
true to show push notification on completionstring
Notification message (wrap in quotes)
Read
Get metadata for cached files.array
Array of cached file objects
Response Example
Response Example
Polling Pattern
Polling Pattern
Delete
Remove cached files.contentServerChange Callback
Called by native runtime when a download completes. This is where you get the file data.Callback Payload
Callback Payload
- When download completes (could be seconds or minutes later)
- When app reopens after background downloads completed
Response Schema
string
Full file path (e.g.,
videos/samples/bigbunny.mp4)string
Your unique identifier
string
File extension (
mp4, mp3, json)string
Absolute device path
string
Use this for playback - localhost URL
string
Original remote URL
string
File size in bytes
string
Cache status (
"cached")string
Unix timestamp
Background Downloads
Downloads continue when users close the app. Native OS handles retry on network failure.1
App reopens
Native finds pending items
2
Callback replayed
Calls
contentServerChange(item) for each completed downloadPlayback
Uselocal_cdn URL for offline playback:
HTTP Upload API
Only available when your app is served via Despia Local Server (not from origin/remote server).
React Hook
Environment Check
Test Videos
Free sample videos for testing Local CDN (CC licensed):Available Test Videos
Available Test Videos
Quick Test Script
Quick Test Script