Tengo and Cache
What's in a name?
Tengo is Spanish for 'I have' and cache is geek speak for storing information. It's also a play on words on that 80s classic 'Tango and Cash'.
So what's is all about then?
After some thought, the lightbulb switched on and it became an immediate choice to use the HTML5 Cache Manifest file as a basis of discovering what resources should cached. This project aims to do just that.
Between the application bootstrapping and a webpage being rendered, the cache manifest is read and each file is downloaded and stored in the iOS application sandbox directory. After all files have been saved, the UIWebView will render an index.html file in that sandbox.
How to use it
- You'll need the iOS SDK, I've been using 3.x.
- Open the Cachemanifest.xcodeproj file in xCode
- Open Cachemanifest-Info.plist file ** alter the values for AppUri and Manifest accordingly to point at your domain and manifest file
- Run the project, if you watch the console, you should see plenty of logging
Current Limitations/Opportunities for Improvement
Currently the application doesn't adhere to all of the HTML5 cache manifest directives. For instance, all resources in 'network' are downloaded where they should be ignored.
Using Fallback will probably break this app at the moment, and it certainly won't don't any redirecting if there's no network connection.
If your application tries to reach out to the web, the URI must include the domain, or it will only look in the cache. It would be possible for the application to intercept the HTTP request and prepend the domain from the plist file if not in the cache.