The tips below can help you achieve the best appearance and performance for your map caches. The tips are arranged in the following categories:
If possible, choose the scales you want to cache before you start designing the map. Work at those scales as you create the map in ArcMap. For quick reference, you can manually load those scales into the dropdown in ArcMap.
Before caching your map, do a visual check of the source map document at each scale which you plan to cache. Make sure that the appropriate layers appear with effective symbology and labeling at each scale. If you need to change the symbology of a layer based on scale, you can copy the layer and paste it back into the ArcMap table of contents. Set a scale range on each copy of the layer and symbolize appropriately for that scale range.
The images below show an ArcMap document that has been symbolized for viewing at two scales. The author of this map copied and pasted the Interstates and Cities layers back into the data frame, then symbolized a "Zoomed in" and "Zoomed out" version for each layer.
In the zoomed out map, the author set a definition query to limit the visible cities to those with a population over 50,000. Also, the author symbolized the Interstates with a thin line.
In the zoomed in map, the author removed the definition query so that all cities are visible. However, the author also added label rules that symbolize larger cities with a larger font. The author also changed the Interstate symbolization to use a thicker, cartographic line symbol.
The author set scale ranges on both the "Zoomed in" and "Zoomed out" layers to ensure that only one of the layers is visible at any given scale. The Rivers and Lakes, County Boundaries, Parks, and State Background use the same symbol whether zoomed in or out, so the author did not create copies of these layers.
If you're creating a map that you intend to cache at many scale levels, you will need to repeat this process, potentially creating many copies of layers in your map document. Use group layers to keep them organized.
Use the Maplex labeling engine in your map document. This will give you the best possible label placement while caching.
Set X Offset and Y Offset values on text symbols to 0. Using text symbol offsets may result in periodic inadvertent label truncation. Use the label engine's offset ability instead.
Explicitly define a data frame background color not used elsewhere in your map (RGB: 1,2,3, is a good choice). Otherwise, any symbols and text that happen to be the same as the background color may be rendered improperly when the background is interpreted as transparent in certain browsers.
You can explicitly set the background color in ArcMap. The background will render as transparent in environments that support PNG 24 transparency.
Before starting a large caching job, make a test cache of a small area at all scale levels. You can do this by setting a custom Full Extent on the source map document that covers a small geographic area. When you've created the cache for this small area, examine the tiles to make sure they look and perform the way you expect. One way to do this is to create a simple Web Mapping Application in Manager that uses the service.
When you're satisfied with the test cache, delete it, reset the Full Extent to the original extent, and cache the whole map.
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. If you use this technique, be sure to use the same tiling scheme for each cache.
If you do 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. The Zoom Level control that appears with fused caches does not appear when you use a multilayer cache in a Web Mapping Application.
Make sure you've created enough scales. Web application users can only see the map at the scales you cache.
ArcMap users see resampled cache tiles when they are in between scales. Caching too few scales causes more resampling and possible distortion of features.
When creating caches that will overlay each other in a Web application, use the same tiling scheme if possible. It's not required that you create all of the caches at all of the same scale levels. However, you should match as many scales as possible.
In the image below, three caches with different scale ranges share the same scales where possible. Shared scales are circled in red:
Although you should try to match tiling schemes when building your caches, you do not need to match image format. After importing a tiling scheme file, you can change the image format before you create the cache. Use these guidelines to choose the appropriate image type for each individual cache:
The UpdateMapServerCache tool is a good way to break up large caching jobs into distinct areas. By doing this, you can avoid caching areas you don't need.
When you run either the Generate or Update cache tools, they create a rectangle of tiles based on the Full Extent of the source map document. Sometimes, a rectangular shape contains area that you don't want to cache. For example, the state of Florida in the United States is the shape of a rotated L. Running one caching job for the state street map results in a rectangular block of tiles containing many unneeded tiles in the Gulf of Mexico.
In contrast, running two caching jobs based on horizontal and vertical rectangles minimizes the number of unneeded water tiles created. To use this technique, set a custom Full Extent on your map, generate a cache for that extent, and set a new Full Extent to add on to your first cache. When you add on to an existing cache in this way, you must use the UpdateMapServerCache tool with the option to Recreate Empty Tiles.
If you need to do this many times, such as for the Hawaiian islands, consider using a scripting environment. You must have ArcGIS Server 9.2, Service Pack 2 or greater in order to script this type of a job.
After you update a cache, you should notify your ArcMap users that they will need to clear their client-side cache before they can see the changes. To do this, they can right-click the layer in the ArcMap table of contents and click Properties > Advanced tab > Clear Cache.
After the cache is created, if you don't want to continue storing all of the source data on your server, you can remove some of the layers from the source map document. Leave at least one layer in the map document (a suggestion is a simple feature class with one feature covering the map extent), and leave the map document in the coordinate system used to create the cache. After you restart the service, you can safely remove the source data off the server for any layers you removed. As long as the service name and the cache name stay the same, users will continue to see the cache when they view the service.
Keep in mind that if you use this technique, users will not get any meaningful results when they query the service. If you want to maintain some queryable layers, you should leave them in the map document and leave the source data for those layers on the server.
At some point, you may need to transfer map caches between folders or machines. For small caches, you can use the operating system’s copy and paste tools. Large caches can be more challenging to copy. This is usually due to the immense number of files involved, rather than the amount of disk space taken by the cache.
Various third-party applications are available that are designed to help copy large amounts of data. For large caches, copying with these applications may prove more stable than using the operating system tools. Some of these applications allow for scheduling and queuing of jobs.
When using FTP to move caches, the transfer may go more smoothly if you zip bundles of files together beforehand. You do not have to apply compression to the zipped files; the goal is just to avoid transferring an unwieldy number of small files. Several third-party applications are available that can simplify the zipping and extraction.