Load this page to verify that it does indeed display the die face with three pips. Modify the code so that it displays the die face with six pips. The first time that you display a specific die face, you may notice a brief delay in displaying the image. This is due to the fact that the dice images are stored on a remote machine and must be downloaded over the Internet. After this first time, however, there should be no perceptible delay.
Modern browsers use a cache to store local copies of images and pages in order to speed access.
Each time an image or page is downloaded, a copy is stored locally on your computer. The next time that image or page is requested, the browser can elect to display the local copy and so save the downloading time. Of course, the computer has only a finite amount of memory for caching, so eventually the cache must be emptied to make room for more recent images and pages. Again, you may notice a delay the first time you display dice faces, but caching will alleviate subsequent delays. Dynamic Images In Lesson 22, you saw how JavaScript code can be embedded in a Web page to generate content dynamically.