Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

appcache on IE, Edge not working after closing of browser

I have a web application, which is partially offline supported.

My appcache file looks like this:

CACHE MANIFEST

# Datestamp 2015-10-07 GIT14a6ade78ef2ab6434871e90f7f1e70784bc1536

CACHE:

/offline/
/bundles/agrihealthahp/css/admin.css
/bundles/agrihealthahp/css/print.css
/bundles/agrihealthahp/css/offline-language-english.css
/bundles/agrihealthahp/css/offline-language-english-indicator.css
/bundles/agrihealthahp/css/offline-theme-default.css
//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css
//code.jquery.com/ui/1.11.2/themes/le-frog/jquery-ui.css
/bundles/bmatznerfoundation/css/foundation.min.css
//fonts.googleapis.com/css?family=Open+Sans+Condensed:300
/apple-touch-icon.png
/apple-touch-icon-57x57.png
/apple-touch-icon-72x72.png
/apple-touch-icon-76x76.png
/apple-touch-icon-114x114.png
/apple-touch-icon-120x120.png
/apple-touch-icon-144x144.png
/apple-touch-icon-152x152.png

/combine.c6f06a9f43e79d6d26af18e22b205cf4.js
/bundles/bmatznerfoundation/js/vendor/jquery.js
/bundles/bmatznerfoundation/js/foundation/foundation.js
/bundles/bmatznerfoundation/js/foundation/foundation.reveal.js
/bundles/agrihealthahp/js/offline-simulate-ui.min.js
//code.jquery.com/ui/1.11.2/jquery-ui.min.js
https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js
https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.4.0/moment-timezone.min.js
/bundles/agrihealthahp/images/dib-8d.png
/bundles/agrihealthahp/images/dib-9da.png
/bundles/agrihealthahp/images/dib-10d.png
/bundles/agrihealthahp/images/dib-10da.png
/bundles/agrihealthahp/images/dib-undefined.png

NETWORK:
*

FALLBACK:

/ /fallback.html

Everything works on Chrome including being able to close the browser and then open it again with www.domain.com/anything when offline, which will go back to the fallback url. Also, I can access /offline/ and work with the application.

Closing browser and reopening doesn't work with Firefox, IE11 and Edge browsers.

Is this a bug in my setup or supposed to work?

like image 285
jdog Avatar asked Oct 06 '15 23:10

jdog


1 Answers

A few things to check:

  1. Make sure you have the extension .appcache and define it in your html like this:

    <!DOCTYPE html> <html lang="en" manifest="/offline.appcache"> </html>

According to http://html5doctor.com/go-offline-with-application-cache/ .appcache is the standard.

  1. Confirm that when you access the appcache file through chrome debugger that it has the mime type text/cache-manifest - if it doesnt then you need to make sure your web server handles the .appcache mimetype, in apache it is done with this line in your config file:

    AddType text/cache-manifest .appcache

  2. I dont know if the shorthand // works in a manifest file (I was unable to find evidence that its supported), try supplying https:// for the external urls.

like image 108
Marty Avatar answered Oct 24 '22 21:10

Marty