Is ApplicationCache for FF / IE 10 fully implemented (or implemented correctly)?

Question:

Cannot get fallback resources for servicing from Application Cache (Offline Cache) when the browser is set to Work Offline.

Environment Information:

  • Windows 7 64-bit SP 1
  • IE 10 ver. 10.0.9200.16438
  • Firefox ver. 18.0.1
  • IIS ver 7.5.7600.16385
  • .manifest MIME Type is text / cache manifest

Details of the manifest:

FALLBACK: / AppCacheDemo / Home / CarNew / Sandbox / Car / AppCacheDemo

How OFFLINE mode starts:

  • IIS Stopped
  • Work Offline selected from the File menu

Demo Application Details:

The attached demo is 3 pages long.

The landing page (/ AppCacheDemo / Home / Index), which is the only page with a manifest file attribute. As a result of the presence of the manifest attribute, it will be automatically placed in the applicationCache.

Online and the corresponding offline version of the page, / AppCacheDemo / Home / CarNew, / AppCacheDemo / Home / CarNewOffline, respectively.

Expected functionality:

The browser detects the presence of the manifest attribute when requesting / AppCacheDemo / Home / Index and loads all the resources listed in the manifest.

User clicks on a link existing at / AppCacheDemo / Home / Index and is redirected to / AppCacheDemo / Home / CarNew

When the browser detects an internet connection, the user / AppCacheDemo / Home / CarNew is presented. When no internet connection is found, / AppCacheDemo / Home / CarNewOffline is served from the Cache app when requests are made to / AppCacheDemo / Home / CarNew.

Steps to reproduce in Firefox (actual functionality):

  • Open FF and clear the cache (alt + ctrl + delete).
  • Request about: cache a. Note that the "Number of Entries" listed in the "Disk" / "Offline" cache are both listed as zero.
  • New Tab and Request / AppCacheDemo / Home / Index
  • Click the Allow button to enable Firefox to store offline data.
  • Go back to about: cache and refresh the page. and. Disk Cache The number of entries should be specified as 3 (may be more depending on your environment) b. Offline cache The number of records should be specified as 3.
  • Click on the List of Cache Entries link in the Disk Cache section (or open the link in a new tab) and note that there are no entries pointing to / AppCacheDemo / Home / CarNew
  • Go back to the tab that has / AppCacheDemo / Home / Index open and click the "Let's build a new link for the car" button a. You should be redirected to / AppCacheDemo / Home / CarNew
  • Go back to: cache? device = disk and note that a new entry exists for / AppCacheDemo / Home / CarNew and its Fetch counter is 1.
  • Stop IIS
  • Select "Work Offline" from the "File" menu
  • Refresh the current page (/ AppCacheDemo / Home / CarNew)
  • Go back to: cache? device = disk and note that a new entry exists for / AppCacheDemo / Home / CarNew and its Fetch counter is now displayed at 2.

Based on information provided under: cache? device = disk for / AppCacheDemo / Home / CarNew, Firefox seems to serve this version of the page for the user. I expected / AppCacheDemo / Home / CarNewOffline to be served from applicationCache because I have a fallback rule defined in my manifest that specifies when / AppCacheDemo / Home / CarNew is requested and no internet connection is served, / AppCacheDemo / Home / CarNewOffline from applicationCache.

Steps to reproduce in Firefox (expected features):

Remember to cancel "Work Offline" before following the next steps.

  • Open FF and clear the cache (alt + ctrl + delete).
  • Request about: cache a. Note that the "Number of Entries" listed in the "Disk" / "Offline" cache are both listed as zero.
  • New Tab and Request / AppCacheDemo / Home / Index
  • Click the Allow button to enable Firefox to store offline data.
  • Go back to about: cache and refresh the page. and. Disk Cache The number of entries should be specified as 3 (may be more depending on your environment). and. Offline cache The number of records should be specified as 3.
  • Click on the List of Cache Entries link in the Disk Cache section (or open the link in a new tab) and note that there are no entries pointing to / AppCacheDemo / Home / CarNew
  • Stop IIS
  • Select "Work Offline" from the "File" menu
  • Type / AppCacheDemo / Home / CarNew in the address bar. and. You should be redirected to / AppCacheDemo / Home / CarNewOffline. The url in the address bar should still read / AppCacheDemo / Home / CarNew, but the document content should be / AppCacheDemo / Home / CarNewOffline
  • In a new tab, ask about it: cache? device = disk and note that no objects exist for / AppCacheDemo / Home / CarNew.

Since / AppCacheDemo / Home / CarNew did not exist in the disk cache, FF respected my fallback rule defined in my manifest and served / AppCacheDemo / Home / CarNewOffline. If I were

Testing in IE:

Except for navigating the cache, the steps above can be more or less followed. The difference is that when IE is set to "Work Offline" and / AppCacheDemo / Home / CarNew is requested, IE will display a page with the message "This page cannot be rendered." If / AppCacheDemo / Home / CarNewOffline is requested directly, IE will serve the page. Since the manifest specifies a return rule, I would expect / AppCacheDemo / Home / CarNewOffline to be served, but it is not.

Testing in Safari / Chrome:

Safari / Chrome does not have a Work Offline menu item and therefore there are some additional steps to be taken before navigator.onLine is reported as false. I have to physically disconnect the CAT 5 cable and disconnect from any VPNs to put the browser in a truly disconnected state; however, reservation rules are respected and / AppCacheDemo / Home / CarNewOffline is served when / AppCacheDemo / Home / CarNew is offline.

AppCacheDemo project (Microsoft MVC 4 web app configured to use IIS):

http://www.filedropper.com/appcachedemo

+3


source to share


1 answer


As it turns out, testing AppCache in Internet Explorer is a bit disappointing. It looks like there are some issues with the offline mode that really make debugging a pain. For example, when I tested this method a while ago, I found that the browser would detect an internet connection and automatically go online to satisfy the request. It really bothered me.

I reached prior to Eric Lawrence , author of Fiddler (web debugger) and previous project manager at Microsoft. Eric confirmed that there is indeed a problem. I suspected that a tool like Fiddler would fix these pains and this was confirmed in a blog post that Eric wrote on the Telerik website titled HTML5 AppCache Testing with Fiddler .



Eric's recommendation worked for me and I was able to test AppCache without issue in Internet Explorer using Fiddler's AutoResponder feature. Hope this helps you too.

+1


source







All Articles