Application Cache Error event: Manifest fetch failed (4)

Sriks picture Sriks · Dec 12, 2014 · Viewed 17.6k times · Source

I am trying to implement AppCache in my application. I have added the corresponding MIME type in IIS. Please see my below html tag

<html manifest="example.appcache">

My manifest looks like:

CACHE MANIFEST

Content/img/logo-header.png 
Content/img/img-sprite.png
Content/img/icon-top-nav-sprite.png

NETWORK:
*

When I try to execute my application, I am getting the below error in my chrome console

Creating Application Cache with manifest http://localhost:7520/example.appcache 
Application Cache Checking event 
Application Cache Error event: Manifest fetch failed ***(4)*** http://localhost:7520/example.appcache 

Can you please help me how to resolve this issue.

Answer

Stuart P. Bentley picture Stuart P. Bentley · Feb 6, 2015

I just ran into this problem on one of my own sites (with error code 4). In the time since the cache had been downloaded, I had instituted a redirect on all URLs on the domain, to redirect to the HTTPS version of the site. It is my suspicion that this error code has something to do with the manifest being unavailable due to a redirect.

In my case, I solved the problem (personally) by clearing the cached files in chrome://appcache-internals, then re-visiting the root site to experience the redirect to the newly-secured version of my domain.

If you are in a similar situation and cannot clear the appcache (say, because you have users who are unaware that they're receiving stale content), you could try changing your site so that requesting the cache manifest at the old URL does not result in a redirect, and instead allows network requests that would allow the browser to download the new version of the page and encounter the redirect. See this question for information on clearing a cache manifest.