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: 
Rek
Visitor

Image Caching

Hi all,

I'm having a problem with image caching with the image canvas component. I have a poster screen which is populated with images. When an image is clicked, I would like to display the image full screen. The image canvas component has been working for this, except that it does not re-load the image. You see, all my images have the same URL. Just before displaying the image, I make a call to my server indicating which image I would like to see, and it moves it to the URL. It appears that this is causing the Roku's internal caching system to always display the first image that was requested in this manner.

I have verified this behaviour by selecting an image from the poster screen, then visiting the URL in a browser, and comparing the image to the one displayed on Roku. The browser always has the correct image. The roku always has the first image.

Here is my display code (note: imageUrl will always be the same string, but when accessed, should return a different image):

m.Data.Photo = photo
m.Data.Screen.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
m.Data.Screen.SetLayer(1, [{
url : imageUrl,
TargetRect : {
x : int(displayX),
y : int(displayY),
w : int(displayWidth),
h : int(displayHeight)
}
}])


This behaviour also persists across multiple image canvas components. If I create one, set its URL, then let it fall out of scope, and do the same with a new canvas, the image initially requested by the first canvas will be displayed.

Does anyone have any thoughts on what my options are? Ideally, I would like to be able to clear the internal image cache.

Cheers
0 Kudos
2 REPLIES 2
RokuMarkn
Visitor

Re: Image Caching

0 Kudos
Rek
Visitor

Re: Image Caching

"RokuMarkn" wrote:
http://forums.roku.com/viewtopic.php?f=34&t=32159


Exactly what I was looking for. Cheers.
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.