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!
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.
Thank you! I am looking forward to meet a new Roku OS 8 to use 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
“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
- [BETA] New file system for data caching — A new file system, cachefs:[/url:3pygd6ez], has been introduced to allow applications to cache data to volatile or persistent storage. Users who extend the persistent storage available on their device by adding an external SD card will see the biggest benefit as application data will survive reboots and benefit from additional cache space to improve performance. Users without extended storage will also benefit from the use of a shared in-memory cache that is automatically managed by the system to optimize for the most recently used assets.
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 mePlease help and thank you for your time.
“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
“and maybe in tmp”
Um.. no.
“squirreltown” wrote:
Um.. no.
The noes have it.
Thank you for information! I highly appreciate, that you saved me a lot of time! ![]()
