Roku Developer Program

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

Roku cache responses from Rest API- how can it be fixed ?

Will Roku cache responses from Rest API ??? If so How can i fix it

In my application, i am getting response via Rest calls. When rest call is invoked it is giving the previous response but not the updated response.

For instance when a new user logs in, we are persisting his details into CSV file in a web application. when we try to get the details of registered users via rest call from Roku, we are not able to get the recently added user details but response contains previous user details.

We tried rdn function to bust the cache but for the first time we are able to get the updated users but on next hit it is giving the previous details.

Kindly help us in getting this issue fixed. Please provide code snippet if possible.
0 Kudos
4 REPLIES 4\
TheEndless
Level 10

Re: Roku cache responses from Rest API- how can it be fixed

As far as I'm aware, roUrlTransfer doesn't cache anything. Some screens will cache images that are downloaded, but roUrlTransfer shouldn't. It sounds like you might have an issue with your REST API. Have you confirmed it using a different client (e.g., a web browser)?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuJoel
Roku Employee
Roku Employee

Re: Roku cache responses from Rest API- how can it be fixed

We tried rdn function to bust the cache but for the first time we are able to get the updated users but on next hit it is giving the previous details.


I'm betting that the rnd() function is only getting executed the first time you make the HTTP request, and the subsequent times you make the HTTP request you are reusing the original string thus the second call has already been cached and you're just getting the cached results.

Joel
0 Kudos
destruk
Level 10

Re: Roku cache responses from Rest API- how can it be fixed

I'd guess the caching is done on your server. You can disable that with extra headers.
0 Kudos
andenagaveni24
Level 7

Re: Roku cache responses from Rest API- how can it be fixed

Thank you all for your responses..
0 Kudos