Channel Feed not updating

I created a channel from the videoplayer example as a developer. I’m now updating the xml files which are stored on my web server, but they aren’t updating. I changed a ton of stuff, but it’s almost as though the xml is cached on the box and is never coming off. How do I make it not cache? I’ve tried turning the box off and on. I’ve tried renaming the xml file, and it still loads…

“SoutheastTv” wrote:
I created a channel from the videoplayer example as a developer. I’m now updating the xml files which are stored on my web server, but they aren’t updating. I changed a ton of stuff, but it’s almost as though the xml is cached on the box and is never coming off. How do I make it not cache? I’ve tried turning the box off and on. I’ve tried renaming the xml file, and it still loads…
Change your channel code to append a unique parameter to the request url, simple timestamps work well for this. Your server can ignore this, it just guarantees that the box (and possible proxies between the box and the server) isn’t caching the content.

e.g.: http://server.com/file.xml?ts=20120220144756

Did you double check your code, and make sure you’re pulling the xml from your site, and not the roku sample site?

gonzotek, could I have it link to a php file that generates the xml?

yungblood, it’s loading the xml file on the server, because when I update the package it will update like it’s suppose to. However if I change the xml without updating the package, then it doesn’t update, as though the xml was cached until I upload a new package.

“SoutheastTv” wrote:
gonzotek, could I have it link to a php file that generates the xml?

yungblood, it’s loading the xml file on the server, because when I update the package it will update like it’s suppose to. However if I change the xml without updating the package, then it doesn’t update, as though the xml was cached until I upload a new package.
Sure, same exact concept. The added timestamp parameter on the request from the roku simply forces the box to pull from the server and ignore the previously cached data. If your php script spits out xml at the url http://server.com/xml_generator.php, just add the timestamp to the request before the Roku sends it:


xml= CreateObject("roUrlTransfer")
'dt is our date object
dt = CreateObject("roDateTime")
'mark sets dt to the current date/time
dt.mark()
url = "http://server.com/xml_generator.php"
'AsSeconds returns the current date/time as the number of seconds from epoch (1/1/1970),
'ToStr converts the number of seconds to a string
url = url + "?ts=" + dt.AsSeconds().ToStr()
xml.SetUrl(url)
xml.getToFile("tmp:/my_generated_xml.xml")

If you have other parameters (e.g. http://server.com/xmlgen.php?genre=comedy) use an ampersand(vs. a question mark) to append additional params:

http://server.com/xmlgen.php?genre=comedy&ts=TIMESTAMP_HERE

Note: I haven’t tested the above script for accuracy, I’m not near a Roku right now.

Ok, so I’ve added a php file that loads the xml. For some reason though it’s still not updating instantly, it looks as if there is a timer for updates, like it checks for updates after 30 minutes or something. Should I not be expecting an instant update? I literally save the xml and then look at my roku expecting change.

I don’t quite understand how this is working. I tried just putting your code into the videoplayer example I was using and now the page doesn’t open. Are there no ways of testing this and receiving error reports? I feel like I’m programming in the blind.

Also I’m not familiar with xml, what is adding a timestamp actually doing? Does xml know how to read ts? or does xml have a $_GET equivalent?

Ok I give. Imagine you were to setup a brand new channel using the videoplayer example in the sdk. What would you add to the code to make it load that categories xml file instantly? This is all I want so I can update the xml and it updates the channel rather than constantly putting up new versions and repackaging.

I’m good to go on this post! Thanks for your help guys!