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 -
- First time everything is loaded fresh.
- Second time, the browser (Chrome) makes a request only for the Manifest file.
- 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 -
- Browser does not fetch the latest data when its back online unless the manifest file expires.
- 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.