This article intends to assist on enabling and disabling cache on a Google cast custom receiver application.
During development, we don’t want the Chrome cast dongle to cache our receiver app because during this phase we are constantly making changes and we want those changes to immediately reflect on the Chrome cast session for testing purpose.
Thankfully, HTML5 addresses this annoyance with the ApplicationCache interface.
The application cache (or AppCache) allows you to specify which files Chrome cast should cache. Your receiver app will load and work correctly, the changes you made will be reflected instantly for the new session.
The first thing to do is to make a cache manifest file called “cache.appcache” on your root folder.
CACHE MANIFEST # v1 2014-11-20 CACHE: NETWORK: *
This file should be referenced on your index.html:
<html lang="en" manifest="cache.appcache">
Under the CACHE section, you will want to list the files that you want to be cached. In my case, it’s empty. But if I wanted to have some images cached, I would include them:
CACHE MANIFEST # v1 2014-11-20 CACHE: images/logo.svg images/background.jpg NETWORK: *
Read more about using the application cache on the Mozilla Developer Network website.