Practice exercises CHAPTER 16 611
■■Items that can operate only when a network connection is present should be listed in
the NETWORK section of the manifest file.
■■The FALLBACK section of the manifest file provides a place to designate file substitu-
tions when in offline mode.
■■It’s a good idea to include a version number in the manifest file. Cached items are not
automatically updated when changed on the server.
■■Various events are available on the window.applicationCache object that provide noti-
fication so your application can react to cache changes.
Lesson review
Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.
- Which of the following is a valid statement for the first line of a manifest file?
A. CACHE
B. CACHE MANIFEST
C. CACHE-MANIFEST
D. CACHE-ALWAYS - Which event is fired after an existing cache has been updated with new resources?
A. downloading
B. cached
C. updateReady
D. completed
Practice exercises
If you encounter a problem completing any of these exercises, the completed projects can be
installed from the Practice Exercises folder that is provided with the companion content.
Exercise 1: Modify a contact book to use IndexedDB
In the previous chapter’s exercise, you created a contact book that is stored in localStorage. In
this exercise, you modify that website to use IndexedDB. If you haven’t finished the practice
exercise in Chapter 15, “Local data with web storage,” the Practice Exercises for this chapter
include a Visual Studio solution that’s ready for you to use. If you’re using Internet Explorer,
you must have version 10 installed.
- Open Visual Studio Express 2012 for Web. Click File and choose Open Project. Select
the ContactBook folder in the Exercise1Start folder and then select the ContactBook.
sln file; click Open.