What is map caching?
Map caching is a very effective way to make your ArcGIS Server maps 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 ArcGIS Server to hand out 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.
Why should I cache my maps?
With caching, the only time you pay the performance penalty for drawing the map is when you create the cache. For this reason, creating the cache might take a long time. However, the benefits of caching make up for the time it takes to create the cache. These are some of the main benefits of caching:
Performance: When you deploy cached maps, your users can get more done because they spend less time waiting for the map to draw.
Quality: With caching, performance isn't affected by how much detail is in the map. It doesn't matter whether or not you used shaded relief, transparency, or the Maplex labeling engine to create your map. A cache is just a collection of images, and the server can return one cached image in more or less the same amount of time it can return any other cached image.
Industry standard: Have you ever gone to a popular Internet mapping site and watched as the little square tiles fill in as you pan and zoom? Often, it takes just a fraction of a second for all the tiles to appear. That's because they're using caching. With ArcGIS Server map caching, you can achieve similar performance for your maps.
What happens during the caching process?
Caching does not happen automatically. To make a cache, you first need to design the map and publish a service from it. 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.
The Manage Map Server Cache Tiles tool, which is used for caching, can be accessed in three ways:
- In ArcCatalog or the Catalog window in ArcMap, expand Toolboxes > System Toolboxes > Server Tools > Caching.
- In ArcCatalog or the Catalog window in ArcMap, right-click the desired service on your GIS server, choose Service Properties, then select the Caching tab.
- If this is your first time creating a map cache, determine the appropriate tiling scheme and choose Create Tiles.
- If this is not your first time creating a map cache, review or update the tiling scheme and choose Update Tiles.
- Under the Geoprocessing menu, select Search For Tools and enter Manage Map Server Cache Tiles in the search dialog box.
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. If you installed all the components of ArcGIS Server on one machine, the installation process created a server cache directory for you. If you installed ArcGIS Server across multiple machines, you need to create the server cache directory yourself. See Creating a server directory if you need help with this.
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 ArcGIS Server 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 may 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, then 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 my 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 only be practical to update your large cache if you can isolate the changed areas and update those only. If the cache is small, you may 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 will draw the results in its native graphics layer format on top of the cached image.
Should I cache a map even when I've optimized it for dynamic drawing?
ArcMap contains a Map Service Publishing toolbar that helps you tune your map for dynamic drawing. This toolbar also helps you publish your map service for use with a fast drawing engine not available in previous releases. Even when you use the Map Service Publishing toolbar to tune and publish your map, you can still create a cache to achieve better performance and scalability. The fast map-drawing engine speeds up the cache creation. It also improves performance when caching tiles on demand.