Comments on: Go offline with application cache https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/ helping you implement HTML5 today Thu, 28 Jul 2016 17:36:34 +0000 hourly 1 By: indranil roychowdhury https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-2128165 Tue, 14 Jun 2016 12:21:38 +0000 http://html5doctor.com/?p=2729#comment-2128165 in offline, when i am attaching image (jpg, png etc.) by using (img src), but when i am changing path, not showing image. Why?

]]>
By: Sangseng Lee https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-2109343 Fri, 01 Apr 2016 04:59:54 +0000 http://html5doctor.com/?p=2729#comment-2109343 I heard this application cache is deprecated from the web standards. But could we use this feature without any problems even this deprecation? Unless we could use this feature anymore because of critical issues, please update feature state.

]]>
By: Mohammad Gouse https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-48852 Thu, 03 Apr 2014 12:52:01 +0000 http://html5doctor.com/?p=2729#comment-48852 Hi ,

My Problem in Offline manifest is,

it properly working in Chrome, Firefox (Desktop) but not working in MAC or IPAD , and not getting any error in console, Once i unplugged my network connection and trying to open the page then getting error as “Safari cannot open the page because it is not connected to the internet”

Please help me to solve the issue………….

]]>
By: sahil vig https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-34817 Mon, 03 Jun 2013 11:31:55 +0000 http://html5doctor.com/?p=2729#comment-34817 Is there a way to programmatically clear application cache?

]]>
By: Muhammad Adnan https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-34555 Fri, 17 May 2013 12:34:47 +0000 http://html5doctor.com/?p=2729#comment-34555 nad and @Cody: I’m looking the same thing

“” I want something like this.
If the user is online, fetch pages from the server.
If the user is offline, fetch pages from the HTML5 App cache.
Can this be done with HTML5. Please comment “”

]]>
By: Fred https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-34089 Tue, 30 Apr 2013 17:14:46 +0000 http://html5doctor.com/?p=2729#comment-34089 To have an online page and an offline page that both have access to the appCache is trickier than it should be, mostly because any pages pointing at the manifest will be cached implicitly (so your online page will be served from the cache, regardless of if you have specified in the FALLBACK section that it should redirect).

You could try adding a window navigator.onLine listener, but firefox will return true in many circumstances even if you have no connection (in fact I don’t know if it will ever return false). The solution I found relies on the fact that every time a page pointing at a manifest loads, it checks for a new manifest and if it can’t find the manifest (most likely because there is no internet connection) it sends an error.

So all you have to do is listen for this error, and redirect to the offline page:
window.applicationCache.addEventListener(‘error’, function(e){
// redirect to offline.htm or whatever
}, false);

it’s not perfect, but as far as I can tell, the only time you’re going to redirect incorrectly is is the manifest changes while the update is being run:
http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#appcacheevents

]]>
By: dhanesh mane https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-34079 Mon, 29 Apr 2013 10:06:06 +0000 http://html5doctor.com/?p=2729#comment-34079 @judica thanks for the link, it really have nice information.

Thanks
Dhanesh Mane

]]>
By: Cody https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-33621 Fri, 12 Apr 2013 06:00:39 +0000 http://html5doctor.com/?p=2729#comment-33621 wups… I guess it didn’t take my HTML.

]]>
By: Cody https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-33619 Fri, 12 Apr 2013 05:59:12 +0000 http://html5doctor.com/?p=2729#comment-33619 Here’s what my offline.manifest looks like:

CACHE MANIFEST

CACHE:
../style.css
../js/jquery-1.7.1.min.js
../js/jquery-ui-1.10.1.custom.min.js
../js/jquery-ui-1.10.1.custom.min.css
../js/underscore-min.js
../js/SDB.js
../js/ndn/ndn-js.js
../js/ndn/ndn-closures.js
../js/ndn/ndn-utils.js
../client.js
../plugins/factory/factory.js
../plugins/favicon/favicon.js
../plugins/pagefold/pagefold.js
cacheManifest.js
offline.js

NETWORK:
*

FALLBACK:

# version 1

Here’s the file that loads the manifest (note that we’re using an HTTP-Routing/MVC system so the “Master” file is “/view/welcome-visitors”):

Smallest Federated Wiki

<!– –>

…

I am getting the cache to work fine…

MY DILEMMA IS that I (like what “nad” says):
“
I want something like this.
If the user is online, fetch pages from the server.
If the user is offline, fetch pages from the HTML5 App cache.
Can this be done with HTML5. Please comment
“
Also, make sure you look at the the cache in the browser…
In chrome, open console/element inspector, click on “Resouces” and probably at the bottom you’ll see “Application Cache”.

I’ll post back if I figure out how to do what nad was asking about.

Happy coding :-)

Cody

]]>
By: Pegi https://stevefaulkner.github.io/html5doctored/go-offline-with-application-cache/#comment-29361 Thu, 29 Nov 2012 19:34:27 +0000 http://html5doctor.com/?p=2729#comment-29361 I’m experiencing a similar problem to Jon only it’s happening on my PC. As soon as I go offline, the browser doesn’t display the offline content it’s supposed to. Instead it gives me an error message explaining that the page can’t be displayed because there’s no connection to the Internet.

I have read and re-read every resource I can find and no one seems to mention this so I’m really stumped. There doesn’t appear to be anything wrong with my coding and the browser does ask if it is allowed to place a cache on the machine. So it appears to be working, just not working offline. Any help would really, really be appreciated.

]]>