[WIP] Appcache

Offline version.
Tips:
- Manage cache in Chrome: chrome://appcache-internals/
Won't this result in an error when the second if statement is true? (length is 1, so arr[1] would fail)

Also, can' fully understand the purpose and logic of this.