HTML 5 Cache Manifest and the iPhone
After experimenting with the HTML 5 cache manifest attribute for caching resources on the iPhone for offline access, I found a few issues with the Apple documentation that I wanted to let the public know about. These small discrepancies caused none of my offline resources to load in the web app. Complete all of the steps Apple describes in its support documents. First, make sure you are setting the Mime Type for ".manifest" to "text/cache-manifest". Secondly, make sure you have a valid manifest file. All you need is the words "CACHE MANIFEST" at the top followed by a list of URLs to the resources you want to be cached. This is where the differences occur: 1. Instead of declaring the manifest file as:
<html manifest="myassets.manifest"> Declare it as: <html manifest="/myassets"> I'm not sure if it was just my server setup, but this allowed the iPhone to see the manifest and start caching the resources. 2. Declare the Mime Type "text/cache-manifest" for both ".manifest" and "manifest": AddType text/cache-manifest .manifest manifest Once, again, I'm not sure if this was a specific server issue for me, but I don't think it can hurt. If this helps you, let me know on Twitter or send me an email and I'll think about expanding this article.





