Using a map cache

This topic contains two parts. The first section outlines how ArcGIS applications access and use the tiles in a map cache. The second section provides some instructions for overlaying map caches in ArcGIS applications.

How ArcGIS applications access and use the cache

When you finish generating a map cache, the map service is automatically restarted and it immediately begins using the cache. Any ArcGIS application that can display a map service uses the cache, although how the tiles are retrieved and used varies between applications.

Web ADF applications

After an initial connection to the GIS server, Web ADF applications retrieve tiles directly from the virtual cache directory. If the virtual cache directory is unavailable, the application may still be able to get the tiles from the cache directory on the file system. If the application cannot get to the cache tiles in either of these two ways, it asks the map service to generate the tile dynamically and the performance benefit of the cache is lost.

Caches created using the "multi-layer" option are only consumable in the .NET Web ADF. With multi-layer caches, the server retrieves tiles for each layer and blends them into one image, draws labels on the image, then sends the image to the client. If the multi-layer cache contains many layers, this process becomes prohibitively expensive and the advantage of the cache is lost.

If you are using the Java Web ADF, or performance of your multi-layer cache in the .NET Web ADF is not satisfactory, you may be able to overlay two or more fused caches to achieve the same visual effect as a multi-layer cache. To do this, use the following workflow:

  1. Place each layer that would have participated in the multi-layer cache in its own map document. Make sure the Full Extent of the map documents is the same.
  2. Publish each map document as a map service.
  3. Create a fused cache for each of the map services. Before doing this, be sure to read the section Overlaying map caches in web applications later in this document.
  4. Add the services to your map with the desired layer order and transparencies. Users of your map will be able to turn the services on and off.

ArcMap

After an initial connection to the GIS server to determine if the service has a cache, ArcMap retrieves tiles from the cache directory on the server’s file system. When a request is made for a tile at a scale that exactly matches a scale level in the cache, the map service returns the tile directly.

Most often, requests do not exactly match the scale levels in the cache. In this situation, ArcMap generally requests the tile from the next-closest scale level and resamples it to match the requested scale. This resampling is still much quicker than generating a tile dynamically; however, it does result in an image that looks different than the original tile. Map labels that have been cached may be difficult to read at certain scales in ArcMap due to this resampling. For best results, view the map at or near the scales from which the cache was created.

ArcMap is the most practical client for consuming multi-layer caches. This is because ArcMap has the ability to blend and label multi-layer cache tiles on the client side (unlike Web ADF applications).

ArcMap maintains a local image cache of the areas you have visited. When you zoom and pan back to these areas, ArcMap uses the local image cache and does not need to get the tile on the server. If you update an area of the server cache that you’ve already viewed in ArcMap, you must clear your local cache in order to see the changes.

To clear the local image cache for an ArcMap layer, follow these steps:

  1. Right-click the layer name in the ArcMap table of contents and click Properties.
  2. Click the Advanced tab.
  3. Click the Clear Cache button.

As a server administrator, you need to alert your ArcMap client users when updated data is available so that they know to clear their cache.

ArcGlobe and ArcGIS Explorer

Although ArcGlobe and ArcGIS Explorer have the ability to add map services as data and consume map caches, you will achieve better performance in these applications by using ArcGIS Server globe services.

One scenario where you still may want to add a map service to ArcGlobe is when you’ve created a 2D map cache and you want to create an identical 3D globe cache from the 2D cache. In this scenario, you would only be concerned with generating the cache and would not be navigating the globe.

Overlaying caches

When designing map caches that will be overlayed with other map caches, there are some important cache design factors to consider depending on which application users will view the caches with.

Overlaying map caches in Web applications

When designing map caches that will overlay other map caches in a Web ADF application, there are certain rules you need to follow in order to ensure the caches overlay successfully. These rules differ depending on whether you are using ArcGIS Server for the Microsoft .NET Framework or ArcGIS Server for the Java Platform. You can find specific guidelines at the following links:

Overlaying map caches in ArcMap

You can overlay any number of map caches in ArcMap. The caches do not have to have the same tiling schemes or projections; however, because of the resampling and reprojecting that ArcMap performs, using equivalent tiling schemes and projections may improve the performance and aesthetic quality of your map. Pay special attention to the image formats of the caches you are using: