Choosing cache properties

Release 9.3 E-mail This Topic Printable Version Give Us Feedback

There are two steps to making a map cache:

  1. Set cache properties.
  2. Create tiles.

This topic is about setting the cache properties. See Creating cache tiles for more about creating the tiles.

Accessing cache properties

When you view a map service's properties in either Manager or ArcCatalog, you will see a Caching tab. This is where you set the tiling scheme and other properties for your cache. You should set these options before you start creating cache tiles.

How to access cache properties in Manager

  1. Click the Services tab in Manager.
  2. Find your map service in the list and make sure it is started, then click the Edit (pencil) icon next to the service.
  3. Click the Caching tab.

How to access cache properties in ArcCatalog

  1. Click GIS servers in the Catalog tree.
  2. If necessary, make an administrative connection to your GIS server.
  3. Expand your GIS server and find the service whose caching properties you want to modify.
  4. Start the service if it is not already started.
  5. Right-click the service and click Service Properties.
  6. Click the Caching tab.

To use a cache for your map service, you first need to choose the option to draw the map service "Using tiles from its cache". If you choose to draw "Dynamically from the data" the server will draw the map each time and the map service will not use any cached tiles you have created.

The information below explains additional settings you can access on the Caching tab. Once you start creating the cache, you can't change these options unless you delete the existing cache and start over. For this reason, it's important to plan the tiling scheme and other properties for your cache ahead of time.

When you've finished setting the cache properties, click the Create Tiles button to start creating tiles. You can also return to this dialog box later and click Update Tiles to create more tiles or update existing ones.

The tiling scheme

The tiling scheme includes the scale levels, tile dimensions, and tile origin for the cache. These properties define where tile boundaries will exist and are important to match when overlaying caches in some clients. Other properties such as image format and antialiasing are also written into the tiling scheme. There are several ways you can choose a tiling scheme:

Scales

If you choose to create your own tiling scheme, you can define the scales yourself or allow ArcGIS Server to suggest some scales for you.

When you choose the Suggest option, the dialog box asks how many scales you want, then the software picks levels that have been increased or decreased by a power of 2 from 1:1,000,000 starting with the level closest to the extent of the source map document. For example, if the source map document has an extent of 1:121,000,000 and 3 scale levels are defined, ArcGIS Server will suggest scale levels at

Once you're familiar with the cache creation process, you'll probably want to pick your own scale levels. If ArcMap is available, you can get an idea of the needed scale levels by adding the map service, or viewing the original map document, at different scales. Take note of the largest and smallest scales at which you want people to view your map.

When setting adjacent scale levels, you can achieve a reasonable zoom increment by doubling the scale's denominator. This is how the ArcGIS Online, Google Maps, and Microsoft Virtual Earth tiling schemes are configured. However, doubling the scale's denominator between scale levels is not required; you can use any increment that you want.

A simple way to create a tiling scheme is to determine the closest scale at which your users will need to view the map, then double the scale's denominator until you reach a scale that would contain your entire area of interest in just one or two tiles. For example, if you were designing a tiling scheme for a city and the closest scale at which someone should view your map is 1:2,400, your scales could be 1:2,400; 1:4,800; 1:9,600; 1:19,200; 1:38,400, until you reach a scale that would cause the entire city to be visible on your computer screen at once.

Tiling scheme origin

The tiling scheme origin is the upper left corner of the tiling scheme grid. The origin does not necessarily represent the point at which tiles begin to be created; that happens when the full extent of the map is reached. Using a common tiling scheme origin for your caches ensures that your caches can overlay each other in Web applications.

In most cases, you should keep the default tiling scheme origin chosen by the software. The default is the upper left point of the coordinate reference defined by the map document. If no coordinate reference is defined in the map document, the upper left of the two times the maximum of the union of extents of all the layers in the map is used.

If you change the tiling scheme origin to something other than the default, be aware that tiles can be created only in the map area to the lower right of the tiling scheme origin. If you want to cache only a certain area of your map, creating tiles based on a bounding rectangle or feature class are better options than changing the tiling scheme origin.

Tile width and height

The default tile width and height is 512 pixels. You can choose any width and height that is a power of 2, but it's recommended that you use 128, 256, or 512. If you are building a cache that will overlay another cache, be sure to use the same tile width and height for both caches.

Choosing a smaller tile width and height may improve performance of the application requesting tiles from the cache, as less data will need to be transferred. However, smaller tile size results in a larger cache size and longer creation time. Because the default Windows disk block size is 4 kilobytes (K), small tiles that may only be 1K in size will actually use 4K of disk space. A larger tile might be 4K in size and fit perfectly in a 4K block. Therefore, four 1K tiles use 16K of space on disk, whereas the single 4K tile covering the same area only uses 4K. With large numbers of tiles, this difference can become significant.

Image format

This setting determines what output image format the map service will use when it creates the tiles. Your choice of image format is important because it determines the size on disk of the tiles, the image quality, and the ability to make the tile background transparent.

Below is a summary of the available image formats and their appropriate uses.

Before committing to an image format for a large cache, build a small cache of a representative area of your map and examine the tile quality and performance in a test application. If you'll be working with multiple caches, build a small test cache for each and add them to a test application to make sure they overlay as expected. This will allow you to make adjustments before you create the entire cache.

To make a small test cache you can do any of the following:

Antialiasing

Antialiasing is a graphics technique that blends foreground and background pixels near edges to trick the eye into seeing smoother borders. The antialiasing performed by the ArcGIS Server map caching process is an approximation that works well with labeling and with line and polygon feature classes without textured fill. This approximation should not be used with raster imagery.

ArcGIS Server performs the antialiasing by downsampling a large map area before cutting the tile into the smaller tiles requested in the tiling scheme. There is a performance cost for using this option. If antialiasing is not needed for improving text and line clarity, do not use it.

Use caution with antialiasing if you are caching vector layers that will overlay a raster image. The data frame background color contributes to the color of the antialiased features. By default, the data frame background color when caching is set to almost white, which can cause antialiased features to appear lighter than intended, especially when placed over dark raster layers such as orthoimagery. For the most effective results with antialiasing, change the data frame background to a darker color that is unlikely to appear in the map before you start creating the cache. Some software tools will allow you to find the average color within a given image, and this can be a good color value to use for your data frame background.

DPI

Dots per inch (DPI) refers to the resolution of the cache tiles that the server will generate. DPI depends on the user's screen resolution (for example, 1024x768) and physical size (for example, 19" diagonal). DPI can vary widely on client machines because of big screens (which lower DPI) and higher-resolution screens and graphics cards (which increase DPI with higher settings). If clients will frequently be printing maps that include your cached layer, you may find it helpful to raise the DPI beyond the default, but be aware that this will increase the size of the files in the cache.

When choosing a DPI setting, the default value of 96 is usually sufficient unless you are working primarily on a network where the majority of your client machines have a different DPI.

Advanced options (cache type)

Clicking the Advanced Options button presents you with the option of choosing a fused or multilayer cache. A fused cache includes all the layers in the map in one fused image. The layers must be turned on and off together.

In contrast, a multilayer cache consists of a set of cached images for each layer. When you display the map, the server must still blend together the tiles from each layer. The more layers you have in your multilayer cache, the longer the blending will take. If you attempt to use a multilayer cache with too many layers, you may lose the performance benefit of the cache. Additionally, the cache takes longer to create because each layer has to be rendered at all scale levels over the extent of the cache.

Use fused caches whenever possible. If you need to be able to turn layers on and off, consider overlaying multiple fused caches instead of using a multilayer cache. To do this, determine some logical groups of layers from your original map document and add each group to its own map document. Publish a service for each map document, then create a fused cache for each one. You can then overlay these fused caches in Web applications or in ArcMap.

Tip: If you use the above technique of overlaying fused caches, be sure to use the same tiling scheme for each cache. Also, add the fused caches directly into the client application for best performance. Avoid embedding one or more services within a service.

If you use a multilayer cache, ArcMap is the recommended client for working with the cache. Using a multilayer cache in a Web application provides little or no advantage over using a non-cached map service.

Creating tiles on demand

The Caching tab contains a check box for enabling on-demand caching. This means that tiles for previously un-cached areas will be added to the cache when they are first requested by a client.

Learn more about when to use on-demand caching.

Performance Tip: When you have enabled on-demand caching, your client applications will achieve better performance using an ArcGIS Server Internet connection as opposed to an ArcGIS Server local connection.

About the server cache directory

The server cache directory is the folder on disk where your cache tiles are stored. One server cache directory can hold multiple caches; however, if you want, you can add more than one server cache directory to your server. On the Caching tab, you can choose which server cache directory will be used to store your cache.

It's a good practice to associate the server cache directory with a virtual directory on your Web server so that tiles can be retrieved through a URL.

Learn more about how client applications get tiles from the virtual directory.

When you install all the components of ArcGIS Server on just one machine, a server cache directory is created for you. (The default location is C:\arcgisserver\arcgiscache.) A virtual directory that references this location also gets created.

If you install the components of ArcGIS Server across multiple machines, you need to configure the server cache directory and its associated virtual directory yourself. For further reading, see Creating a server directory and Configuring a multiple-machine deployment. Be sure to give the SOC account Write access to the server cache directory so that ArcGIS Server can successfully place the tiles in the directory. You can optionally remove Write access when you finish creating your caches.

Folder structure in the server cache directory

You can open the server cache directory in Windows Explorer to examine the cache tiles and tiling scheme file conf.xml. The tiles are organized into a directory hierarchy. The top-level directory has the same name as the map service unless the service was created in a GIS server folder. If the map service is in a folder, the top-level directory is named <folder name>_<map service name>.

Under the top-level directory, you'll find a subdirectory for the particular data frame in the map being cached. Next, depending on whether you've created a single fused cache or a multilayer cache, you'll find either a single subdirectory _alllayers, or multiple subdirectories, each named after the specific layer being cached in the multilayer cache. Within each layer subdirectory, you'll find subdirectories for each level of detail, followed by subdirectories for each tile row, and finally, the actual image files that represent a particular column in the row.

Note: A server cache directory can also contain a GlobeCache folder, which contains all the globe caches stored in the server cache directory.