3

I am reworking an app I made a while ago to also work offline. When the page loads, the cache.manifest is found and it caches all the pages correctly. However, when I refresh the page when not connected, I get a ton of errors.

One of the errors is Manifest fetch failed (6), which, according to this answer means a NETWORK_ERROR. Obviously I am not connected to the internet, but obviously that is the point of making a website available offline, right? All the other errors are from some of the files I use, saying net::ERR_INTERNET_DISCONNECTED, but these files are also in the cache.manifest, so to me that does not really make sense.

I don't get a totally blank page either. Inspecting my page does reveal my index page, but it seems like the others do not load correctly.

Looking into the chrome://appcache-internals/ it also shows all the files in the cache correctly.

This is what my cache.manifest looks like:

CACHE MANIFEST

CACHE:
images/aRandomImage.jpg
bower_components/polymer/polymer.html
bower_components/polymer/polymer.js
bower_components/polymer/layout.html
#etc

Possibly also worth noting is that I'm using Polymer 0.5. I have also tried turning off Chrome running in the background and removing the cache folder, but with no avail. What am I missing?

Community
  • 1
  • 1
jdepypere
  • 3,453
  • 6
  • 54
  • 84

3 Answers3

7

Check to make sure that disable cache is not checked on the network tab.

Google Chrome Manifest fetch failed (6) Is the error that Chrome throws when the appcache triggers an error event (see this for a decent primer on appcache events). This is normal when the browser detects that you are offline.

In that event, however, the browser will typically will still load resources from the appcache as normal. Since chrome://appcache-internals/ shows the expected content it leads me to believe that you perhaps have caching disabled.

Are you developing on localhost or a remote machine?

Mike Nitchie
  • 1,166
  • 2
  • 13
  • 29
  • I double checked and the `disable cache` is disabled. When I reload my page the network tab always displays a different amount of files that did load correctly, whilst others didn't. One time all-but-one was loaded correctly, another time not even half of them. I'm currently on a remote machine because testing locally I had issues regarding the connection-state not being the same as the server being online, and since I was having these odd issues, I thought that might've been a problem. – jdepypere Jun 15 '15 at 16:34
  • Hmm. A few other questions. Are you sending the cache manifest with a content-type of `text/cache-manifest'? Are all of the resources in your cache manifest being retrieved successfully? If even one fails for whatever reason the whole cache process will fail. Possibly, this could be a weird [firewall](https://productforums.google.com/forum/#!topic/chrome/iuHvC6LDIqg) issue as well – Mike Nitchie Jun 15 '15 at 18:13
  • Yes, I have set the content type in my `.htaccess` like so: `AddType text/cache-manifest .manifest`. When I check the headers of the manifest it is the correct type. Also it does state that the cache was successful and no errors were found in the console. I'll look into the firewall issue. – jdepypere Jun 15 '15 at 21:27
  • Thanks, "`disable cache` is not checked on the network tab" made my day. – tabalin Oct 26 '16 at 07:04
2

I had the same problem that drove me mad... but I found that I was actually doing my tests by refreshing the page, which makes the cache load weirdly.

To test your offline app, you have to restart Chrome on Android on each test.

Hope this will help

AntoineR
  • 21
  • 2
1

This error can also be caused by the relevant web site's SSL certificate expiring.

ajayel
  • 3,027
  • 2
  • 26
  • 33