html5 appcache - firefox displays fallback page for files mentioned in Network section that not be cached -
we using html5 offline cache. have polling code checks whether user in connected or disconnected server/network. online detection done calling 1 test jsp page mentioned in appcache file under network section. checking works in chrome returning response status 0.
but not work in firefox. firefox displays fallback page instead of giving offline status (code 0). respone status code still 200 in case.
my appcache is:
cache manifest index.html network: testisonline.jsp fallback: / fallback.html and code check status is:
$http({method: 'get', url: 'testisonline.jsp', cache: false}).success(function(data, status) { console.log("user online: status:"+status); }).error(function(data, status) { console.log("user offline: status:"+status); }); and calling test page 'testisonline.jsp' contains:
<!doctype html> <html> <head> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="tue, 01 jan 1980 1:00:00 gmt" /> <meta http-equiv="pragma" content="no-cache" /> <title>to test online status</title> </head> <body> test page </body> </html> when disconnect server, in chrome output "user offline: status:0".
in firefox still i'm getting "user online: status:200".
how detect offline mode here?
Comments
Post a Comment