HTML and CSS Reference
In-Depth Information
Listing 8-7. Mapping the MIME Type Using web.config
<system.webServer>
<staticContent>
<mimeMap ileExtension=".cachemanifest" mimeType="text/cache-manifest" />
</staticContent>
</system.webServer>
The fileExtension attribute of the <mimeMap> element specifies the file extension of the cache manifest
file, and the mimeType attribute specifies the cache manifest's MIME type.
Testing an Offline Application
Now that you've completed all the steps required to create an offline application, let's test the Clock
application using Chrome. Assuming that you have the project opened in Visual Studio, press Ctrl+F5 to
run the application. Clock.aspx is loaded in the browser as shown in Figure 8-2 earlier. To ensure that the
application is really being served from the browser cache, open the Visual Studio development web server
(IIS Express) and stop the application (see Figure 8-4).
Figure 8-4. IIS Express list of applications
Now, refresh Clock.aspx . Ordinarily you would receive an error at this step because the web
application is stopped; but because the browser has cached the application locally, Clock.aspx is refreshed
from the cache.
Open another browser tab, type chrome://appcache-internals in the address bar, and press Enter. You
should see a page similar to that shown in Figure 8-5.
Figure 8-5 shows how Chrome displays details of offline applications. You can see all the files listed in
the cache manifest. You can also manually clear the cache by clicking Remove.
 
Search WWH ::




Custom Search