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

5

9

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.

Barbershop answered 31/5, 2013 at 13:58 Comment(0)
M
9

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.

Merete answered 6/6, 2013 at 12:9 Comment(2)
The subdomain split is a nice idea, although it would be hard to implement as the site is single-page. Beside the 1000 cache entry limit there also seems to be a 50MB limit and this looks like to be the culprit in our case. The 1000 item limit would have bitten us anyway if it were not for the huge videos, so I'll accept this answer. Thanks!Barbershop
Well spotted. The details for IE10 are here and do confirm the 50MB limit and maximum of 1000 resources in the manifest.Highoctane
C
7

For the record: I had trouble with IE (10) giving me AppCache Fatal Error. It turns out IE requires the manifest to be served with the proper content-type, that is

Content-Type: text/cache-manifest

Chrome and Firefox aren't as picky.

Controvert answered 26/9, 2013 at 22:4 Comment(2)
This was the fix for me. For IIS, add <mimeMap fileExtension=".manifest" mimeType="text/cache-manifest" /> to the <staticContent> section of web.config.Farrah
This also seemed to be causing mouseenter/leave errors in angular for some odd reasonIlanailangilang
W
3

In case it helps anyone, I've found another way to rectify this error.

If you are using the Application Cache and set the Cache-Control header for the html file with the cache.manifest entry to "Cache-Control: no-cache, no-store", you will receive this error. Removing the no-store flag for the Cache-Control header will fix the issue in this instance. I was trying to use the Application Cache for resources only and not for the html page itself, but unfortunately that's not what it was designed for.

Also note that all other browsers will just ignore the no-store flag for files in the cache.manifest, whereas IE is technically doing the right thing by being a little more pedantic.

Wilding answered 20/9, 2013 at 0:40 Comment(0)
M
1

Internet explorer Group Policy sets limitation of cache resource list size to 1000 items. This can be extended by changing this policy. More can be found here , part "Set maximum application cache resource list size".

Mispronounce answered 12/3, 2014 at 13:18 Comment(0)
G
0

My problem was, that IIS used the .manifest-Extension and set the Content-Type to x-ms-manifest. So I added the following into the web.config - this solved the fatal error (IE 11) and the appcache now works with HTTPS (SSL) which it didn't before (only worked with HTTP):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="."
            inheritInChildApplications="false">
    <system.webServer>
...
      <staticContent>
        <remove fileExtension=".manifest"/>
        <mimeMap fileExtension=".manifest" mimeType="text/cache-manifest"/>
      </staticContent>
...
    </system.webServer>
  </location>
</configuration>
Gastrointestinal answered 25/8, 2016 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.