0

I am trying create an app which has offline features. The manifest file that I have created looks like this-

CACHE MANIFEST 
# version 1.0.0

CACHE:
/ShareBill.Web-Offline/
/ShareBill.Web-Offline/Groups
/ShareBill.Web-Offline/Content/Site.css
/ShareBill.Web-Offline/Content/jquery-ui.css
/ShareBill.Web-Offline/Scripts/ShareBill.js
/ShareBill.Web-Offline/Scripts/lib/jquery-1.7.2.min.js
/ShareBill.Web-Offline/Scripts/lib/jquery-ui.min.js
/ShareBill.Web-Offline/Scripts/TransactionsIndex.js
/ShareBill.Web-Offline/Content/Images/ajax-loader.gif
/ShareBill.Web-Offline/Content/Images/br_down_icon.png

NETWORK: 
/ShareBill.Web-Offline/Transactions/Filters

What I expect is when I view this url /ShareBill.Web-Offline/Groups. My browser should not make any requests to the server else the whole purpose of being offline would be void.

But as I can observe using fiddler is that, the browser makes a request for the manifest file every time i refresh the page. I made sure that I see the cached resources in the Chrome dev tools.

Now when I turn my IIS off and make a request like this, I end making my AppCache status as OBSOLETE. Then on the very next page refresh, I get a 404 response. Am I missing something in terms of implementation?

tusharmath
  • 10,622
  • 12
  • 56
  • 83
  • The AppCache should only be set to `OBSOLETE` if the request receives a 404 or 410 response, your server would need to be running for the browser to receive such a response. If the server is not running, the browser would receive no response at all. – robertc Jul 06 '12 at 15:31

1 Answers1

0

I applied the Expires header to request that was asking for the Manifest file. And that worked :)

tusharmath
  • 10,622
  • 12
  • 56
  • 83
  • What expires header did you apply? The app is supposed to request the manifest file every time so that it can find out whether or not there's been an update. – robertc Jul 06 '12 at 15:26
  • I added an Expires date of 2050-01-01 (yyyy-mm-dd). This in essence would make no requests at all to the server. There is still a problem, I need to purge the application cache when the file any js file at the server end is updated. Even though I update my manifest file, I will not get those changes on the client since the manifest file it self is cached. – tusharmath Jul 07 '12 at 04:13
  • If your manifest file never expires then your appcache will never be updated, that's why the browser is checking the manifest file every time. – robertc Jul 07 '12 at 12:26