What is map caching?
In this topic
- What happens during the caching process?
- Can I cache all my maps?
- Can I still get to the underlying data?
- How do I get started with caching?
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 that 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 that 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. You can find out more by reading 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 that you pick and the properties you set for the cache are the tiling scheme. Each cache has a tiling scheme file that you can import when you create new caches so that 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 that 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.