2

This has been bugging me a lot, I have a .net MVC application which needs offline support. I am rendering the Manifest file dynamically as a view.

While making page refreshes what I have observed is -

  1. First time everything is loaded fresh.
  2. Second time, the browser (Chrome) makes a request only for the Manifest file.
  3. Now in all subsequent requests, only the Manifest file is requested (Server returning a 200 response) and other files are fetched from the cache.

This does not give me complete offline support, since the browser is still making requests to the server. Ideally if the app supports offline functionality, it should still work when my IIS is stopped, right?

To resolve this I have added an Expiry date of 2hrs (say for example) to the manifest file only. This makes my problem even worse in 2 ways -

  1. Browser does not fetch the latest data when its back online unless the manifest file expires.
  2. After 2 hours if the app is still offline, it returns a 404 error (don't know why) as the manifest file has expired and the server is down.
Jim Counts
  • 12,535
  • 9
  • 45
  • 63
tusharmath
  • 10,622
  • 12
  • 56
  • 83
  • possible duplicate of [Offline app in asp.net](http://stackoverflow.com/questions/11364377/offline-app-in-asp-net) – robertc Jul 07 '12 at 19:35
  • The browser is supposed to keep making the requests the server for the manifest file, the problem you need to investigate, as I pointed out when you asked about this before, is why you're getting a 404 from a server that is not online. The only way you should be able to get a 404 is if there is a server sending a response. – robertc Jul 07 '12 at 19:38
  • This is just a hypothesis, I am getting a 404 because when my IIS is stopped my host is still available. So it is able to reach that host but the file is not found. Ideally in case i was accessing the host thru the internet and if I din't have a live internet connection, it would behave differently. – tusharmath Jul 08 '12 at 09:57
  • 1
    You need an actual web server to get a 404. A 404 is an HTTP status, you only have a 404 if you've received an HTTP response. – robertc Jul 08 '12 at 11:32
  • what if you cut off the connection from Chrome to the server/internet completely, does the app still work? – Andrei Rînea Jul 07 '16 at 21:04

0 Answers0