Below are common questions that have been asked about map caching. Topics range from basic to advanced. In many cases, the answers restate information found elsewhere in the help; however, this topic may provide an answer to your specific question faster than searching the help.
General caching questions
Map caching questions
- How do I generate a full cache at some scales and a partial cache at other scales?
- How do I display a Data not available tile for empty cache areas?
- How do I avoid duplicate labels in my cache?
- When creating a cache based on an area of interest, why do I see extra tiles created outside the area of interest?
- When creating tiles on demand, why are extra tiles created outside the user's map extent?
Manage Map Server Cache Tiles and other caching tools do several things behind the scenes that require restarting the service before and after the tool runs. If the caching tools alter the conf.xml tiling scheme file, restarting is required for the map service to pick up the changes. For example, if you used Manage Map Server Cache Scales to add or delete scales from your cache, restarting would be required for the map service to recognize the changes to the tiling scheme.
The service is briefly unavailable while restarting.
If you have high-resolution data and you want to build a cache at the ArcGIS Online/Bing Maps/Google Maps scales plus your own set of larger or smaller scales, follow this workflow:
- When defining your cache in the Service Editor window of ArcMap, use the Tiling scheme drop-down list to choose A tiling scheme file.
- Browse to <ArcGIS for Desktop installation location>\TilingSchemes\ArcGIS_Online_Bing_Maps_Google_Maps.xml.
- In the Service Editor window, click Advanced Settings.
- Type a scale you want to add and click Add. Repeat this process until you've added all the scales you want.
- Continue with publishing the service and building tiles.
An alternate workflow for existing caches is to run the Manage Map Server Cache Scales tool.
Yes. If you have multiple ArcGIS Server sites, for example, such as a development site and a production site, you can share the cache directory between the sites. This eliminates the need for you to copy or replicate the cache from one site to another. This also allows you to read from and write to a single cache directory from multiple sites.
When setting up your cache directory to be accessible between sites, you'll need to share the directory over your network and grant each site's ArcGIS Server account access to the cache directory. This account is used to read and, if necessary, write tiles to the cache. To learn more about the ArcGIS Server account, see The ArcGIS Server account.
You should only grant the necessary level of permissions to the ArcGIS Server account. For example, if the site you're sharing the cache directory with only needs to read tiles from the cache, you should only grant read permissions to the account. Conversely, if you'll be creating cache tiles from each site, you'll need to grant read and write access to the ArcGIS Server account for each site.
If you'll be creating cache tiles in the same cache directory from multiple sites, you need to exercise extreme caution as your existing caches may be overwritten by another site. For example, if you have two map services with the same name on different sites, you may overwrite the existing cache for the map service on site A if a cache job is accidentally started for the map service on site B.
After you've shared your cache directory, you'll need to update each site to reference the shared network location. For instructions, see Editing a server directory in Manager.
No. The cache tiles, tiling scheme, and folder structure are retained on disk. If you want to delete the cache completely, use the Delete Map Server Cache tool. If you want to delete the tiles but leave the cache folder structure and tiling scheme, use the Manage Map Server Cache Tiles tool with the Update Mode set to Delete_Tiles.
At large scales, it's often a good practice to pre-create the tiles that you anticipate will be the most popular and set the rest of the tiles to be created on demand. In contrast, at small scales, you might want to create a full cache because the small scales require fewer tiles and will be frequently viewed by clients when they initially see the map.
You can run the Manage Map Server Cache Tiles tool multiple times to build a partial cache at some levels of your map and a full cache at other levels.
Suppose you have a map that you want to cache at these scales:
You could run Manage Map Server Cache Tiles and check only the 1:128000, 1:64000, and 1:32000 boxes. By default, the full extent of those scales will be cached.
Then you could run the tool again and check only the 1:16000, 1:8000, and 1:4000 boxes. Also, you could choose to cache these scale levels based on the extent of features in a feature class, such as a city or county boundary, instead of caching the full extent of the map. This creates a partial cache at those three scale levels. Optionally, you could choose to have the rest of the tiles at those scales be created on demand.
If an area of your cache does not exist, you can either create the tile on demand or configure your web server to return a Data not available tile. The Data not available tile is also useful if someone pans to the edge of the map or browses to an area where you have not completed caching. Configuring your server to return a Data not available tile can, in some cases, yield a better user experience than returning nothing.
- Create an image of the same dimensions and image format as a tile in your tiling scheme. Name it missing.png or missing.jpg. If a clear blank tile is needed (such as for overlay services that require transparency), use blank.png instead. To download an example tile, see Esri Knowledge Base article 36939.
- Save the missing.png, missing.jpg, or blank.png file under the _alllayers folder for the map service, for example, C:\arcgisserver\arcgiscache\MyMapService\Layers\_alllayers\missing.png.
The server automatically handles missing tiles by replacing the expected but missing tiles with the special missing or blank tile at the root level of the cache.
If you are using a dynamic labeling engine in your map document to place labels (as opposed to annotation), you might occasionally see duplicate labels in your cache tiles. These should not occur any more frequently than 4,096 pixels in any direction. You can eliminate all duplicate labels by using annotation. When you use annotation, labels are associated with one point on the map and duplicates do not occur.
When creating a cache based on an area of interest, why do I see extra tiles created outside the area of interest?
To avoid duplicate labels on tiles, the caching tools originally draw areas of 4,096 pixels by 4,096 pixels (256 tiles of the default 256 by 256 pixel tile size), which are then cut into tiles of the size you requested in your tiling scheme. Depending on the tiling scheme, as well as the location and shape of your area of interest, some tiles in the 4,096 by 4,096 area might fall outside the boundary of the area of interest. This is expected behavior. You should not see tiles created outside the boundary of your area of interest beyond 4,096 pixels in any direction.
When you request new tiles (either on demand or using the caching tools), the tiles are always created in groups. The caching mechanism will never create just one tile at a time. If it did, you would see many duplicate labels because the server would not be aware of the labels on adjacent tiles.
When you have on-demand caching enabled and you pan to an uncached area, a 4,096 by 4,096 pixel area is drawn by the server and cut into tiles (this area is 2,048 by 2,048 when using antialiasing). Therefore, if your tiles are 256 by 256 pixels in dimension, you could expect up to 256 tiles to be created. If your map contains many layers or complex symbols, this could result in long wait times for the client.
For this reason, it's strongly recommended that you pre-create tiles for popular areas of your map and use on-demand caching only in the less popular areas. Avoid building your entire cache on demand if you have a complex source map document.