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: 
Kosso1
Reel Rookie

How to 'cache' the JSON response from a roUrlTransfer task?

Jump to solution

I have a Task which gets some JSON and provides content for my initial MainScene RowList. 

How can I store and retrieve the JSON response somewhere, so that I can process it again on another Screen without having to make the HTTP request again? 


Is `cachefs` the way to go? 


(I'm amazed how many things I thought would be really common use cases seem to be so impossible to find in the documentation.) 

0 Kudos
1 Solution

Accepted Solutions
RokuBen
Community Moderator
Community Moderator

Re: How to 'cache' the JSON response from a roUrlTransfer task?

Jump to solution

Both writing to tmp: and cachefs: will work.  tmp will go away when your channel ends, while cachefs may potentially still be around on a relaunch if the device didn't need to reuse that memory.

View solution in original post

0 Kudos
2 REPLIES 2
RokuBen
Community Moderator
Community Moderator

Re: How to 'cache' the JSON response from a roUrlTransfer task?

Jump to solution

Both writing to tmp: and cachefs: will work.  tmp will go away when your channel ends, while cachefs may potentially still be around on a relaunch if the device didn't need to reuse that memory.

0 Kudos
Kosso1
Reel Rookie

Re: How to 'cache' the JSON response from a roUrlTransfer task?

Jump to solution

Thanks. 
Yes, I'd ended up writing the JSON to cachefs:/... 

But it took quite some time to dig around the Documentation site to find out how to do it. (with WriteAsciiFile(path, data) )

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.