Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
kidasov
Level 7

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
tim_beynart
Level 7

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
Level 7

Re: Image caching

Thank you! I am looking forward to meet a new Roku OS 8 to use image caching Smiley Happy
0 Kudos
Roku Employee
Roku Employee

Re: Image caching

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

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
Level 7

Re: Image caching

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

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 Smiley Sad Please help and thank you for your time.
0 Kudos
Roku Employee
Roku Employee

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
Level 8

Re: Image caching

"and maybe in tmp"

Um.. no. 
Kinetics Screensavers
0 Kudos
Roku Employee
Roku Employee

Re: Image caching

"squirreltown" wrote:
Um.. no. 

The noes have it.
0 Kudos
kidasov
Level 7

Re: Image caching

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