Search code examples
iosfirefoxsafarioffline-cachingofflineapps

Firefox / Safari not storing any offline cache data


Given the following appcache-manifest :

CACHE MANIFEST
#offline.manifest
#version 1.0 3-18-20141
CACHE:
offline.php
NETWORK:
*
FALLBACK:
* offline.php

And two simple php-files :

<!DOCTYPE html>
<html lang="de" manifest="offline.manifest">
<body>Offline, ohooohoo!
</body>
</html>

and:

<!DOCTYPE html>
<html lang="de" manifest="offline.manifest">
<body>Online, sucks!
</body>
</html>

I neither can get Firefox, nor Safari on IOS to work offline correctly. The manifest-file is delivered with the correct MIME-Types:

  AddType text/cache-manifest .appcache
  AddType text/cache-manifest .manifest

I'm quite amused that Firefox nor Safari is working, but Chrome. Using the about:cache?device=offline Option in Firefox, i get the following respoonse :

http://localhost/HTML5_SDK/offline.php  0 bytes     8   2014-03-18 17:34:49     2014-03-18 17:34:49

Which frankly means that a) my file is size zero and b) is expired as delivered. I am freaking around with that stuff the whole day, and already did many nasty things as complety reinstalling the browser, killing mit Iphone with a brand new iOs and so on.

Chrome tells me that the offline.php is stored as FALLBACK EXLIPCIT with 465b, which matches.

Did anybody already manage to really get an offline-manifest with fallback working crossplattform-wide?

thanks for your adviced and best regards

Florian


Solution

  • You cant use a wildcard in the Fallback section. This must be a URL pattern and might be enough to ruin the day for your browser.

    You can achieve the same thing by specifying root.

    FALLBACK:
    / offline.php
    

    Lastly, if one of those php pages is offline.php then this does not need to be added to your CACHE: section because you have explicitly requested it in the html tag. From my experience it shouldnt hurt though.