Using appcache with php & database

I am developing web applications using jQuery Mobile. These apps use a database to get prices, etc. (Using php). I am also using appcache to be able to use apps offline.

<html manifest="manifest.appcache">


This all works great. But when I'm online, I don't want applications to use appcache. How to do it?

I can check if I am online / offline by checking if the file is available:

    error: function()
    success: function()


However, I cannot find anything that the page does not use appcache ..

Did I miss something?


source to share

1 answer

Step by step solution:

  • Check if you are online / offline
  • If you are online, run a php script that adds # to the end of the appcache manifest. This is because the cache will be updated if the manifest has changed.
  • Minimize the cache and refresh the page

After I finally got it working, I noticed that it doesn't work in Firefox due to the swapCache () function. ( ) Luckily my users are not using Firefox.



All Articles