0

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.

Lucas Zamboulis
  • 2,494
  • 5
  • 24
  • 27

2 Answers2

2

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

Rich Finelli
  • 882
  • 7
  • 18
1

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.

markasoftware
  • 12,292
  • 8
  • 41
  • 69
  • I have turned off wifi and IIS but still no luck. – user1985466 Feb 22 '14 at 15:20
  • It's also very possible you're not transmitting the file with the correct MIME type. Make sure your server is configured to send out `.appcache` files with the `text/cache-manifest` MIME type. I'm not sure how to do that on IIS (I only have used Apache and Node.js), but I don't imagine it's very difficult to set up. And still make sure that you actually go offline when testing. – markasoftware Feb 22 '14 at 23:11
  • MIME type is set on IIS any other suggestion will be appreciated. – user1985466 Feb 23 '14 at 05:29