Moved appcache logic into the webpage.