Reputation: 1
I have a small webapp and I am working on appcache (offline caching) feature of HTML5. following is my Manifest file code: File name: Manifest1.appcache
CACHE MANIFEST
#21/02/14
CACHE:
Login.htm
.........
and in my Login.htm I just have simple text to display and I have manifest="Manifest1.appcache"
in html opening tag.
I have deployed this on IIS and it works fine while IIS is on, when I stop IIS I can access this page once and then i get 404. It fires (Application Cache Obsolete event)
. I have no clue why, please help.
Upvotes: 0
Views: 2368
Reputation: 917
not sure if this is it. But I had trouble with my manifest file and it came down to a couple file names spelled incorrectly. Have you tried validating the manifest file to make sure all files are spelled correctly?
Here's a good tool for this: http://manifest-validator.com/validate Put in the url to the cache manifest i.e. something like http://www.yoursite.com/manifest.appcache
I made a few mistakes where I accidentally didn't include the folder in the path to the image. This tool worked well to find those mistakes. Also, if you're using Grunt, there is a grunt task called grunt manifest that will auto build the manifest file to avoid spelling mistakes and so on. https://github.com/gunta/grunt-manifest
Upvotes: 2
Reputation: 12672
The obsolete
event fires whenever the device is online (or at least if it seems that way to the browser) but the manifest file cannot be retrieved. So, shutting down the server does not simulate being offline properly, because the browser still thinks that it's online (which it is), but it can't retrieve the manifest file, which, to the browser, is the same as if you had deleted the manifest, so shutting down the server isn't how you should be testing this. The best way to simulate being offline is...being offline! Turn off wifi on your device, and then all should work well.
Also make sure that your server is configured to serve .appcache
files with the text/cache-manifest
MIME type, some browsers require that.
Upvotes: 1