Map caching is a very effective way to make your map and image services run faster. When you create a map cache, the server draws the entire map at several different scales and stores copies of the map images. The server can then distribute these images whenever someone asks for a map. It's much quicker for the server to return a cached image than to draw the map each time someone requests it. Another benefit of caching is that the amount of detail in the image doesn't noticeably affect how quickly the server can distribute the copy.
What happens during the caching process?
Caching does not happen automatically. To make a cache, you first need to design the map and share it as a service. Then, you'll set some cache properties and begin creating tiles. You can choose to create all the tiles at once or allow some of the tiles to be created on demand, that is, when someone first visits them.
When you cache a map, you draw it at more than one scale so users can zoom in and out of the map. When choosing properties for your cache, you'll need to determine what scales you want to use for caching. If you're just trying out the caching tools for the first time, you can let the computer pick some scales for you. However, you should usually pick your scales earlier so you can design your map to look good at those scales. Write down the scales and use them as you do your cartographic design in ArcMap. When it's time to create the cache, you can enter the scales into the cache generation tool.
There are other properties that are important to understand when you create the cache. For more information, see Available map cache properties.
The cache is stored in your server cache directory. When you installed ArcGIS for Server, a server cache directory was created for you in a local folder. If you add more GIS servers to your site, you need to share your server cache directory (using operating system options such as Windows file sharing) so it can be accessed by other machines in your site.
The scales you pick and the properties you set for the cache are the tiling scheme. Each cache has a tiling scheme file you can import when you create new caches so all your caches use the same tile sizes and scales. This can help the performance of your web applications that contain more than one cached service. Optionally, you can choose to use the well-known tiling scheme of ArcGIS Online, Google Maps, and Bing Maps so you can easily overlay your caches with these online mapping services.
Can I cache all my maps?
A map cache represents a snapshot of your map at one point in time. Because of this, caches work best with maps that do not change frequently. These include street maps, imagery, and terrain maps.
If your data tends to change, you might still be able to use the caching tools to periodically update the cache. You can even schedule these updates to occur automatically. To understand whether your frequently changing map can still be cached, it helps to ask these questions:
How up-to-date does my map need to be?
If the data you see on the map needs to be live, with no time delay acceptable, caching is not appropriate. However, if a short delay is acceptable and the cache updates can be performed within that time window, you can still use caching.
How big is the cache and how widespread are the changes to my data?
These two questions go together. A large cache takes more time to create. It may be practical to update your large cache only if you can isolate the changed areas and update those alone. If the cache is small, you might be able to quickly rebuild the entire cache.
If the update cannot keep up with the changes in an acceptable amount of time, the map is not appropriate for caching.
After considering the questions above, use caching whenever it's appropriate. The performance benefit that you gain is probably worth the investment it takes to create and update the cache.
To learn more about updating your cache, see Map cache updates.
Can I still get to the underlying data?
Although map caches represent pictures of the data, you can still allow others to perform identify, search, and query operations on your map service. These tools can get the geographic locations of features from the server and return the results. The application draws the results in its native graphics layer format on top of the cached image.
How do I get started with caching?
To get started with caching, you must first publish a map or image service. As part of the publishing process, you will set properties in the Service Editor dialog box. This is where you can define the scales and extent of your cache. Follow the steps in How to publish a service to learn how to reach the Service Editor.
You can choose to create the tiles immediately when you publish the service (appropriate for small caches) or build the cache on your own after publishing (appropriate for large caches where you want to geographically limit the amount of cache built at large scales). If you build the cache on your own, you will use the Manage Map Server Cache Tiles geoprocessing tool, available in the Server Tools toolbox.
Software components used to create and maintain map caches
Below is an overview of the important parts of the software you need to know about when creating and maintaining map caches.
Caching tab
From the Caching tab of the Service Editor dialog box, you can specify that the service should use a cache and subsequently configure required settings such as its tiling scheme. In the Advanced Settings subtab, you can choose additional options such as image format and whether to configure on-demand caching.
This tab is available in the Catalog window of ArcMap when you publish a service or display the service properties.
For guidelines on using the Caching tab, see Available map cache properties.
Generate Map Server Cache Tiling Scheme tool
The Generate Map Server Cache Tiling Scheme tool allows you to create a tiling scheme for your map, which includes the scales for caching, the coordinate system of the cache, and other essential properties. The tool output is a tiling scheme file in XML format. When you create a new cache, you can browse to the tiling scheme file to load these properties.
It's a good practice to create a tiling scheme with this tool and use it on multiple caches within your organization.
Manage Map Server Cache Tiles tool
The Manage Map Server Cache Tiles tool allows you to create, update, or delete tiles in an existing cache. You can access this tool by right-clicking your service in the Catalog tree and clicking Manage Cache > Manage Tiles.
Since Manage Map Server Cache Tiles is a geoprocessing tool, it can be scripted just like any other tool to help you update your cache on a regular basis.
Cache directory
The ArcGIS Server cache directory is the folder on disk where your cache tiles are stored.
You can open the server cache directory to examine the cache tiles and the tiling scheme file conf.xml. A cache directory can also contain a file geodatabase status.gdb that contains information about which tiles have been built.
The image below shows an exploded format cache in Windows Explorer where each tile is stored as a single file. With a compact format cache, you would see larger files called bundles that store multiple tiles.
To learn more about the server cache directory, see Available map cache properties.