Offline Support

While many buildings you walk into today have an internet connection, the reality is that many brick and mortar businessesExternal Link do not have a reliable one.

Raydiant devices come with a built-in cache to make your apps resilient to network disruptions and reduce bandwidth consumption.

If the device is unable to connect to the internet, it will automatically serve cached content while the device is offline.

On-Device Cache

All requests made by your app will automatically be cached on the device, with the exception of requests with a Cache-Control header value of max-age=0.

To enable the on-device cache, make sure to return a Cache-Control header value of at least max-age=1 on all your responses.

Reducing Bandwidth

Some customers run their devices on cellular networks with bandwidth constraints.

To minimize the amount of bandwidth used, the on-device cache will automatically cache content depending on the Content-Type of the request.

Content Type TTLs

Below is a table of the TTL values of the on-device cache by content type.

Content types that never expire such as images and videos will need to be cache busted manually if they are dynamic.

application/json

Cached for 5 seconds

application/pdf

Cached forever

application/octet-stream

Cached forever

binary/octet-stream

Cached forever

image/jpeg

Cached forever

image/gif

Cached forever

image/png

Cached forever

image/bmp

Cached forever

image/webp

Cached forever

video/webm

Cached forever

video/ogg

Cached forever

video/mp4

Cached forever

application/binary

Never cached

~*mpegurl

Never cached

Next Steps


Was this article helpful to you?
GitHubProvide feedback

Last edited on April 17, 2024.
GitHubEdit this page