I’ve build a small web app for the iPad which I was hoping to be able to run offline by using the manifest cache but I can;t get it to work.
I am serving the cache-manifest file as a MVC view and setting the content type to text/cache-manifest. The manifest get’s processed but doesn’t add any items to the cache. Using Firebug I’ve tried to view the window.applicationcache but it’s empty.
Must be missing something obvious!
The head of my HTML page looks like this
<!DOCTYPE html>
<html manifest="/graduates/manifest/">
<head>
And this is the Manifest, I’ve tried without relative paths and still can’t get it working.
<%@ Page Title="" Language="VB" Inherits="System.Web.Mvc.ViewPage" %>
<% HttpContext.Current.Response.ContentType = "text/cache-manifest"%>
CACHE MANIFEST
#v1
/common/styles/grad.css
/img/graduateapp/apple-touch-icon.png
/img/graduateapp/background.jpg
/img/graduateapp/facebookQR.png
/img/graduateapp/facebooksmall.png
/img/graduateapp/twitterQR.png
/img/graduateapp/twittersmall.png
SOLUTION : Had a Carriage return on the first line so wasn’t working properly, top of manifest is now
<%@ Page Title="" Language="VB" Inherits="System.Web.Mvc.ViewPage" %>
<% HttpContext.Current.Response.ContentType = "text/cache-manifest"%>CACHE MANIFEST
Had to add all my .js files as well as this caused problems even with a wifi connection!
“The first line of an application cache manifest must consist of the string “CACHE”, a single U+0020 SPACE character, the string “MANIFEST”, and either a U+0020 SPACE character, a U+0009 CHARACTER TABULATION (tab) character, a U+000A LINE FEED (LF) character, or a U+000D CARRIAGE RETURN (CR) character. “
http://www.w3.org/TR/html5/offline.html