Learn HTML : The Image/Template Cache

We will always want to add images into our surveys to perhaps show a company logo or some items of clothing that you are running the survey about. To get images into your surveys you could upload the images onto your company website and reference them from there, but that would require help from your web administrator. A better way to use images is to use the Image Cache that mrInterview provides. The image cache provides an efficient method of activating and accessing images for all DimensionNet applications that need them. When an application requires an image, ImageCache.aspx on the mrInterview Web Server uses pull-based activation to communicate with a machine in the Interviewing Services Tier to fetch images and serve them to the browser. The advantages of pull-based activation are as follows:

  • Activation remains very simple as all the images are only copied to FMRootMaster.
  • Activation still works when one or more Web servers are down.
  • If images are cached on the Web server they only take up space when they are accessed.
  • HTTP can be used to pull the images from a Web server that is inside the firewall.

So how do we use the image cache, well lets take our basic template


 <mrPageTitle/>
 
 
 
   
   
 
   
   
   
   
LOGO GOES HERE
            
Footer Information

and put the following code where the logo should go,

activate the job and run the url and we will see the following.

Smiley Logo
Smiley Logo

So what happens , basicaly the ImageCache.aspx checks whether the project mrTags and the image logo.gif exists in its local FMRootMaster directory. If the image exists here, ImageCache.aspx then checks with the internal IIS whether this is the latest version of the image. The cache is updated with the image or a newer version of the image if necessary, and then the image is streamed to the browser with a MIME type image/gif. MIME mapping uses the operating system’s internal MIME support, and MIME type resolution is performed using the same methods as in the IIS metabase. If either FMRootMaster or the Internal IIS is not available, the image cache streams copies of existing local images. If the local images do not exist, the image cache returns a 404 (file not found) HTTP error.