8

When I launch my receiver app on the chromecast device, it goes to the URL where my html is hosted to retrieve the receiver app to launch it.

However, when I update the contents of the HTML and JS sources on the hosted server and close the app on the chromecast, and relaunch the receiver app again, I often get the old version of the app and not the updated version that's already on the server.

I think this has to be some cache issue. I've disabled cache via the developer tools via the debugging port (9222), rebooted by device, created a cache manifest that tells it to cache nothing, it still wouldn't work, everytime I launch the receiver app on the device, it continually pulls the old version of the app from the URL.

Does anyone has any tips or solutions as to how I may force the chromecast to pull the latest version already on the hosted server?

thanks! :)

just a follow-up, when doing a curl on the command line, i'll always get the latest version. Just that the chromecast device keeps on getting the older version.

jchionh
  • 115
  • 1
  • 6
  • if it helps, my receiver app is hosted on github pages (gh-pages branch). Perhaps it's an issue with the CDN not refreshing the data yet. – jchionh Sep 29 '13 at 23:01

3 Answers3

6

Open the DEBUG (javascript ) console http:// your chromecast ip:9222/ on Chrome browser while your receiver is visible.

Then enter the command window.location.reload(true); in the bottom of the console. This works every time I've tried it. It is also a good way to test broken session handling in your app as the refresh breaks any connections the page had setup. So it isn't perfect, but it will get the new content loaded.

caller9
  • 2,207
  • 1
  • 18
  • 11
  • This code works now, but I suggest for further usage to stick with documentation and use window.location.reload(true); (the true stands for forceGet – load from cache or not) – JakubKnejzlik Jun 11 '14 at 22:42
  • Is this functionality still applicable at this day and age (late in November 2014AD)? I wasn't so lucky to see anything when I attempted this. –  Nov 09 '14 at 18:16
3

You may also try adding <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> to your receiver page. In cases that I ran into this issues, rebooting the chromecast device had always cleared the cache.

HTH, Ali

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
2

The Chromecast will cache the receiver if it's currently loaded. It will request a new Receiver if it's at the homescreen.

You can launch another app on your Chromecast then launch your Receiver again.

From the command line, you could do something like:

curl http://<ip of Chromecast>:8008/apps/YouTube

to launch the YouTube Receiver, then you could launch your own again.

  • So if I do a window.close() in the receiver to take it to the home screen and then launch the receiver again, will chomecast will fetch a new version from the URL? Or do I need to specifically launch another app like you suggested above and then launch the receiver again? thanks! :) – jchionh Oct 02 '13 at 22:03
  • Once window.close() is called, it should not be caching it. P.S, don't forget to √ the answer. – Les Vogel - Google DevRel Oct 03 '13 at 00:33
  • Thanks for the confirmation :) If this is the behavior and I still get the old version of the receiver app on re-launch, that means the problem isn't on the chromecast, and most likely due to caching issue either on the proxy server or the CDN. – jchionh Oct 03 '13 at 01:23
  • If your receiver is coming from a CDN it might take a while for changes to propagate. – Les Vogel - Google DevRel Oct 04 '13 at 19:04
  • I had to do a curl http://192.168.x.x:8008/apps/YouTube -DELETE to get the stinker to work. No idea why. Also, unfortunately: **nothing re-cached.** It was the same old/broken receiver as before. :/ –  Nov 09 '14 at 18:15