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

Does roUrlTransfer cache response?

I am using roUrlTransfer::AsyncPostFromString() to get some JSON from a remote server and there appears to be some caching going on. Does roUrlTransfer automatically cache the response? If so how long does it cache for and can it be controlled?
0 Kudos
2 Replies
Roku Employee
Roku Employee

Re: Does roUrlTransfer cache response?

No, it does not cache transfers. Perhaps the server you are working with caches requests, or something else is going on with your code.

- Joel
0 Kudos
Highlighted
sonnykr
Level 7

Re: Does roUrlTransfer cache response?

I am having the same issue. The response I get from brightscript code is different (expired) from what I get from a curl/chrome client. I added a cache buster (a random value) at the end of the url, and it worked just fine.

http://www.example.com/programs/channel1?date=2015-10-21
retuned expired data and fixed by adding a random value

http://www.example.com/programs/channel1?date=2015-10-21&random=<some_random_value>

This works fine for query params method, but I have REST apis that does not allow that extra value. Is there a way to overcome this? I added Cache-Control : cache-none header, doesnt seem to be working either.

Any help appreciated. Thanks!
0 Kudos