Developer Documentation Library > Interviewer - Server > Architecture > Web Service tier > Image/Template cache > How the image cache is used > How the web service uses the image cache
 
How the web service uses the image cache
The UseImageCache property in the mrIWeb web.Config file determines whether or not the Web Service will use the Image Cache. This file is normally in [INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\Interviewer Server\Server\mrIWeb. By default it is set to True:
<add key="UseImageCache" value="True"/>
If you disable use of the Image Cache, UNICOM Intelligence Interviewer assumes that you have a separate template/image server. If you have a separate server, you must copy all required templates and images to the template/image server manually as the activation process does not do this for you. You must also set the TemplateLocation and ImageLocation properties: see Where the web tier looks for templates and How the web service sets image references.
When use of the Image Cache is enabled, the Web Service inserts the Image Cache's URL in front of any external file references. File references can appear in the questionnaire script using the Image style, or in the HTML template via the mrNavButton and mrRef tags. For example, if the Image style property is set to "img1.gif", the Web Service will generate HTML of the form:
<img src="http://ServerName/SPSSMR/ImageCache/ImageCache.aspx?Project=ProjectName&amp;File="img1.gif" alt="img1"/>
If the image or file reference in the script begins with http: or https:, the Web Service does not insert the Image Cache URL before the filename. This allows the interview or template to reference files on an external server.
The Image Cache URL that the Web Service inserts is as follows:
protocol://servername[:port]/SPSSMR/ImageCache/ImageCache.aspx
where protocol (http or https), servername, and port are based on the incoming web request. The port is not included in the URL if it is the default port for the protocol. For example, if the incoming request is for webserver1.spss.com using http, the Image Cache URL will be:
http://webserver1.spss.com/SPSSMR/ImageCache/ImageCache.aspx
In most instances, the default Image Cache URL is correct because the mrIWeb IIS extension will be configured with the same server name, protocol, and port as the Image Cache. However, if you want to use a different URL you might define it in ImageCacheURL key in the mrIWeb Web.config file.
Loading templates when ImageCacheURL cannot be used locally by the web service
The Web Service also uses the Image Cache to load templates from servers in the Interview Tier. Unfortunately, in many web server configurations, the URL used to reference the Image Cache from the respondent’s browser cannot be used locally by the Web Service. A common example is where the Fully Qualified Domain Name (FQDN) is required in the browser URL, but cannot be used locally.
To specify the Image Cache URL to be used for loading templates, set the LocalImageCacheURL key in the mrIWeb web.Config file. By default, this is set to reference the local, unqualified computer name.
<add key="LocalImageCacheURL" value="http://ServerName1/SPSSMR/ImageCache/Imagecache.aspx"/>
Try not to confuse ImageCacheURL and LocalImageCacheURL.
If you change the mrIWeb Web.config file you must reset the Web Service before the changes will be recognized. See Resetting IIS and the services for more information.
ImageCacheURL
Defines the URL used to reference files in the rendered HTML sent to the respondentÕs browser.
LocalImageCacheURL
Defines the URL used to load templates when ImageCacheURL cannot be used locally by the Web Service.
See also
How the image cache is used