gabrielecirulli/2048 — pull request #26 by TheSavior (2014-03-12 11:49:32+00:00)
Title: Adding a cache manifest

As mentioned in issue #24, having a cache manifest will enable the game to work offline, especially useful for mobile devices.

Please note, app cache, while extremely useful can be a source of some headache if you have never used it before. I would recommend reading this article from html5rocks giving a basic tutorial: http://www.html5rocks.com/en/tutorials/appcache/beginner/

Here are some key pieces to know, enabling this for the production version is key, you likely don't want to have it enabled when in development. You can disable it by clearing the cache (clear browser cache / incognito / chrome://appcache-internals/ if you are on chrome), and then commenting out the manifest section of the html tag.

In order for the browser to know to redownload changes to the appcache, the appcache needs to be modified. That could be adding a blank space, having a comment (any line starting with #), etc. Having a comment like #v1 and just changing the number is a common thing to do.