Greetings all --
I am still learning quite a bit and I am sure this is a very simple question.
I am rebuilding our Roku channel to remove deprecated code and make some minor changes to the layout of the scene. I want to be able to change the background image of our scene depending on time of year without resubmitting our channel to the testers.
At the top of my scene in the first init I set the scene parameter m.top.backgroundURI = "http://myurl.com/myimage.jpg". When I side load for testing on multiple Roku units the remote image comes up. But when I change the image on my web server for testing purposes, it does not update on the side loaded app. If I reboot my Roku and then side load again, it shows up.
Have I done something incorrectly? Is it because it is side loaded?
The image is publicly accessible from my server, so I know that is not the issue.
Any thoughts or help is appreciated.
Below is a snippet of the code used in my brs file: (not the actual image url)
sub init() 'To see print statements/debug info, telnet on port 8089 m.top.backgroundColor = "0x676e80" m.top.backgroundUri = "http://myserver.com/roku/images/myimage.jpg"
Roku devices cache images. It's probably documented somewhere, but I've never looked for it. Try adding a "cache buster" to the end of your URI. Something like
http://myserver.com/roku/images/myimage.jpg?cb=834768239
Change the number after cb to something random every time your channel starts. Your server should ignore it.
There may be a documented way to handle it, but like I said, I've never looked for it.
You don't need to reference it to anything. Just add any random string prefixed with "?cb=" ("cb" is also arbitrary) to the end of your URI and the server should ignore it, but the Roku will think it's a different image so it can't load it from its cache. You can test the idea with curl:
curl -I http://myserver.com/image.jpg curl -I http://myserver.com/image.jpg?cb=12345
They should produce the same output.
Roku devices cache images. It's probably documented somewhere, but I've never looked for it. Try adding a "cache buster" to the end of your URI. Something like
http://myserver.com/roku/images/myimage.jpg?cb=834768239
Change the number after cb to something random every time your channel starts. Your server should ignore it.
There may be a documented way to handle it, but like I said, I've never looked for it.
I didn't think it would cache that well, but it makes sense.
How would I implement the cache buster? Obviously it is something I would have to include in the bright script, but do I need to reference it to anything?
Any help is appreciated.
You don't need to reference it to anything. Just add any random string prefixed with "?cb=" ("cb" is also arbitrary) to the end of your URI and the server should ignore it, but the Roku will think it's a different image so it can't load it from its cache. You can test the idea with curl:
curl -I http://myserver.com/image.jpg curl -I http://myserver.com/image.jpg?cb=12345
They should produce the same output.
That worked.
I appreciate it very much. Thanks