AppCache misbehaving in Safari, Firefox
Asked Answered
N

0

6

I'm having some major trouble with AppCache.

I've got a single page application (with real URLs using using Page.js and loading HTML from the server on page load, (dispatch: false)

It's running on Bode.js, in particular it's a Sails.js app.

I've got a manifest file in the HTML tag of the layout. The manifest file has been tested repeatedly and everything checks out. It works flawlessly in Chrome. Even in Safari, it shows up in the inspector correctly and has a list of the assets listed in the file. So far so good.

However, when offline, Safari fails to load anything but the HTML document itself. So I'm basically seeing just an unstyled list of headers. The console shows a bunch of 404s. So even though it's reading the manifest file correctly, it's not caching anything.

Firefox doesn't even detect the manifest file and just seems to working like it didn't exist.

Safari on iOS7 is behaving like Firefox and not showing anything, when offline.

Anyone with any bright ideas why this may be happening?

Nichollenicholls answered 18/12, 2013 at 10:35 Comment(7)
my manifest file was called manifest.appcache, but the apple docs said it should be .manifest, so i changed the file name to cache.manifest. Both behave in exactly the same way in all browsers. I've triple checked the MIME type and it is correctly text/cache-manifestNichollenicholls
The plot thickens. I tried an appcache demo site: appcachefacts.info/demo/index.html And it has the exact same behaviour as my site. So more and more, i feel like i've not done anything wrong and the browsers are misbehaving.Nichollenicholls
Can you show us your manifest file?Septuagenarian
I'm having no problems in Firefox, but Safari in iOS is completely broken. Tested on an iPad and iPad mini.Condemn
@Septuagenarian Sorry, I got rid of the manifest file for now and dropped offline support. But trust me, my manifest file was pristine. Safari has some deep problems with app cache.Nichollenicholls
Also I tried multiple app cache demos online, and they all have the same problem in Safari. The files just don't load offline. It seems Safari treats app cache in a very different way. It only uses to make page load faster and doesn't actually help with it being offline.Nichollenicholls
Check all paths in manifest important! Check max size of yours file (5mb is max by default). Offline mode is problem , maybe your site in some reason have needs for network .Cowgill

© 2022 - 2024 — McMap. All rights reserved.