Search code examples
debugginginternet-explorer-10html5-appcache

How can I find out what causes AppCache Fatal Error on IE10?


I'm trying to create an HTML5 Application Cache for a very large (about 2 gigabytes) web app that will be used internally on a Windows 8 Professional tablet and IE10. Something is causing the caching process to fail, but the only debug information I can find is the F12 console, which simply states "AppCache Fatal Error".

I made an error handler and tried to debug:

if (window.applicationCache)
{
    var oAppCache = window.applicationCache;
    oAppCache.onerror = function(e) {
      alert(e); // Outputs [object Event], I use this row as a breakpoint target
    };
}

However, e contains no useful information when viewed with the debugger.

According to the web server logs, the last file requested before the error is a JPEG just like many others. Where should I start looking for clues about what is causing the error? The page caches fine on Firefox.


Solution

  • Bashed my head against the same issue for a while. I binary-chopped my manifest until I worked out which line was causing the error: it was the 1000th line of CACHE entries (not just the 1000th line of the manifest).

    It seems there's a hard limit on the number of items you can have in a cache in IE10. I haven't found this documented anywhere after a few minutes searching, but I daresay someone more persistent might trawl it up.

    I verified that it doesn't matter what the content of the 1000th CACHE item is; IE just prevents you outright from beginning the cache download. It might be a restriction for security reasons, stopping someone flooding the cache, or using it to DoS a site by injecting a manifest with thousands of entries into a page.

    Perhaps try splitting your app into chunks (over subdomains?) with different caches. Might make for a better user experience if it's downloaded in chunks, you can always automate the "install" by redirecting between a series of smaller caches.