use HTML5 appcache only if disconnected from internet

77 views Asked by At

I would like to configure my manifest file so that if a user visits the site while disconnected from the internet or they get disconnected while they are browsing, the next page they visit will be from the appcache. other wise if they ARE connected they will get served a fresh page.

1

There are 1 answers

2
Ben On BEST ANSWER

If a given page is in the appcache, and assuming the cache has downloaded to your machine / device, whether you are connected or not, you will see the cached version of that page.

However, if that page is subsequently updated, you can be sure of the user seeing the latest version of it if you trigger an appcache update (i.e. by changing the byte signature of your manifest file). Thus you ensure that your connected users see the most up-to-date content, whilst disconnected users still have content to look at.