Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kidasov
Channel Surfer

Image caching

Sup, guys! Can someone tell me how to cache images and videos in Roku. How much cache size is ? 
I read this topic about file system https://sdkdocs.roku.com/display/sdkdoc/File+System I didn't found any storage type that can be used for caching.
Any help will be appreciated! 
0 Kudos
8 REPLIES 8
tim_beynart
Channel Surfer

Re: Image caching

you can save to tmp storage but there is no way to determine how much memory is available.  We use code to delete the oldest images when downloading new ones and keep very few images locally to avoid issues with storage.
0 Kudos
kidasov
Channel Surfer

Re: Image caching

Thank you! I am looking forward to meet a new Roku OS 8 to use image caching 🙂
0 Kudos
RokuNB
Roku Guru

Re: Image caching

"kidasov" wrote:
Thank you! I am looking forward to meet a new Roku OS 8 to use image caching 🙂

to curb your enthusiasm: i doubt cachefs:/ will make any difference from tmp:/ for you, assuming there is no "sacrificial" USB flash drive plugged. I don't think that is common, except for RokuTV owners that use Live TV Pause
0 Kudos
kidasov
Channel Surfer

Re: Image caching

"RokuNB" wrote:
"kidasov" wrote:
Thank you! I am looking forward to meet a new Roku OS 8 to use image caching 🙂

to curb your enthusiasm: i doubt cachefs:/ will make any difference from tmp:/ for you, assuming there is no "sacrificial" USB flash drive plugged. I don't think that is common, except for RokuTV owners that use Live TV Pause

Copy paste from here https://blog.roku.com/developer/2017/10/02/roku-os-8-developer-release-notes

I thought that shared-in memory cache gives permissions to the roku storage to create files, that are retained when application exits. Am I incorrect? So how I can apply image caching to my app?
Is there a way to cache images, because every time we  close app, we lose all data, we can't save anything in storage. After user opens app he always downloads same assets again.
It is a bad practise for me 😞 Please help and thank you for your time.
0 Kudos
RokuNB
Roku Guru

Re: Image caching

"kidasov" wrote:
I thought that shared-in memory cache gives permissions to the roku storage to create files, that are retained when application exits. Am I incorrect? So how I can apply image caching to my app?

Files should persist this way on app exit/restart - in cachefs: and maybe in tmp: (unsure about the latter) - but not through reboot. And there are low-memory conditions when the device needs memory, it will be flushing cache files to make space. Which is typical of caches. Side note is optimize your images for size - higher compression or maybe design for HD instead of FHD, so images download faster
0 Kudos
squirreltown
Roku Guru

Re: Image caching

"and maybe in tmp"

Um.. no. 
Kinetics Screensavers
0 Kudos
RokuNB
Roku Guru

Re: Image caching

"squirreltown" wrote:
Um.. no. 

The noes have it.
0 Kudos
kidasov
Channel Surfer

Re: Image caching

Thank you for information! I highly appreciate, that you saved me a lot of time! 🙂
0 Kudos