HTML and CSS Reference
In-Depth Information
Creating a Cache Manifest
As mentioned earlier, a cache manifest is a text file that lists files to be cached. In this example, you use
.cachemanifest as the file extension and learn how to inform IIS about this extension.
The cache manifest file consists of a cache manifest declaration followed by one or more sections:
CACHE , NETWORK , and FALLBACK . The cache manifest declaration looks like this:
CACHE MANIFEST
All cache manifest files must begin with this line. Other than the CACHE section, the other sections are
optional and are discussed next.
n Note Cache manifest files are case sensitive. Be sure you key in the section names as well as file names
exactly as shown in the example code.
The CACHE Section of the Cache Manifest
The CACHE section of a cache manifest lists all the files that are to be cached on the client side. The files may
include web pages, images, style sheets, and JavaScript files. For example, the Clock application uses the
files listed in Table 8-1.
Table 8-1. Files Used in the Clock Application
File Name
Description
Clock.aspx
The main web form where the clock is displayed
StyleSheet.css
The CSS file that includes styles being used in the Clock application
Scripts/jquery-1.7.2.min.js
A jQuery library that is necessary for the Clock application to work
Images/HTML5.png
An HTML5 logo that is displayed at the bottom of the Clock application
The files displayed in Table 8-1 are specified in the cache manifest as shown in Listing 8-1.
Listing 8-1. CACHE section of the Cache Manifest File
CACHE MANIFEST
CACHE:
Clock.aspx
Images/HTML5.png
StyleSheet.css
Scripts/jquery-1.7.2.min.js
Notice that the CACHE section name is followed by a colon ( : ) character. Files to be cached are listed
one per line.
CACHE is an implicit section. That means if you don't explicitly specify CACHE , the files are assumed to
belong to the CACHE section. So, Listing 8-1 and Listing 8-2 are equivalent.
 
Search WWH ::




Custom Search