Is there a way to preload(cache) audio assets?

#1

First of all, I love Expo and thanks for all the effort to make it happen!

I’ve encountered an issue while I develop an app using Expo
I used this (https://docs.expo.io/versions/latest/guides/preloading-and-caching-assets.html) for images.
But I couldn’t find any for audio assets.
Right now I just loaded audio assets when the app start. That works for the purpose of preloading for my case but curious if it also caches them for the future launching the app.

0 Likes

#2

I believe asset downloads are cached as long as the server sends back HTTP headers telling the client to cache the response. Assets hosted by Expo have these headers, so you don’t need to do anything in that case.

Of course if the OS decides to clear the cache, then you’ll have to redownload them, but the app will generally make an effort to cache assets.

1 Like

#3

Thanks for the answer!

0 Likes