Application Cache Error: Manifest Error (4)
I am trying to implement AppCache in my application. I added the appropriate MIME type to IIS. See my below html tag
<html manifest="example.appcache">
My manifest looks like this:
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 get the following error on 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
Could you please help me to solve this problem.
source to share
I just ran into this issue on one of my sites (with error code 4). In the time since the cache was loaded, I have set up redirects in all urls of the domain to redirect to the HTTPS version of the site. My suspicion is that this error code has something to do with the manifest not being available due to a redirect.
In my case, I solved the problem (personally) by clearing the cached files in chrome: // appcache-internals and then revisiting the root site to redirect to the newly secured version of my domain.
If you're in a similar situation and can't clean up your app (say, because you have users who don't know they are receiving outdated content), you can try modifying your site so that requesting the cache manifest at the old url does not to the redirect and instead allows network requests which will allow the browser to load a new version of the page and encounter the redirect. See this question for information on clearing the cache manifest.
source to share
What worked for me was just opening the manifest in notepad and saving how UTF-8 works. Just tell the browser that UTF-8 won't do, the file must be UTF-8 encoded.
I also followed the instructions on this blog http://www.codemag.com/article/1112051 to learn how to create a standalone app.
source to share
Just disable the device emulator inside chrome if you are using it, or see below for a detailed explanation on how to fix it.
Just found the problem for me. I was busy building a mobile site, so when building it, I used the Google Chrome developer tools to emulate the User Agent / Device emulator.
Once I disabled this feature it worked fine.
The problem is that the user agent passed to the main page load and the user agent for the manifest do not match, thus throwing an error, as my code will redirect (302) the user if he is not visiting via mobile.
The user has theoretically visited via a mobile device, but Chrome does not send the "fake" user agent set on the device selector when requesting the manifest content.
So we get the main page: 127.0.0.1 - - [31 / Aug / 2016: 12: 53: 58 +0200] "GET / HTTP / 1.1" 200 7578 "-" "Mozilla / 5.0 (iPhone, iPhone OS 9_1 eg Mac OS X) AppleWebKit / 601.1.46 (KHTML eg Gecko) Version /9.0 Mobile / 13B143 Safari / 601.1 "
Then the manifest is retrieved: 127.0.0.1 - - [31 / Aug / 2016: 12: 53: 58 +0200] "GET / manifest.appcache HTTP / 1.1" 200 130 "-" "Mozilla / 5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit / 537.36 (KHTML, for example Gecko) Chrome / 52.0.2743.116 Safari / 537.36 "
Then it tries to force the master page to index it, but the user agent is incorrect here: 127.0.0.1 - - [31 / Aug / 2016: 12: 53: 58 +0200] "GET / HTTP / 1.1" 302 - "-" "Mozilla / 5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit / 537.36 (KHTML like Gecko) Chrome / 52.0.2743.116 Safari / 537.36 "
source to share