Web users expect very responsive mapping applications these days. For example, users expect a seamless panning experience when navigating a map and immediate map refresh when zooming to a given location.
Map caching makes that user experience possible. From a technical point of view, a map cache is simply a large collection of prerendered map images (map tiles) that are stored on your Web server. Web mapping applications simply fetch these map images as needed to your Web browser without having to wait for those map images to be created dynamically as was previously the case. In a nutshell, when you cache a map, you create up front all the map images that Web mapping applications will ever request and these map images are ready to go. This approach has another advantage: your Web mapping applications will scale much better to increased demand because the load on your server is reduced.
Is the map cache showing the latest information in my GIS database?
Because Web map applications are accessing map tiles that have been created in advance, you might be looking at data that is no longer current. Fortunately, ArcGIS Server provides tools to update your map cache efficiently. For example, it is possible to selectively update the geography and level of detail at which changes are relevant. In addition, to accelerate map display, some client applications keep copies of the map tiles on the end-user machine. This is called a client cache. ArcGIS Server allows you to configure map services to prevent client caching. You can also clear the client map cache manually in ArcGIS Explorer and ArcMap anytime. To clear the local cache of a Web browser, close it, reopen it, and click F5. This is usually all that is required to ensure that you are accessing the latest map tiles from your map service.
How long will it take to create my cache? How much space will it take on disk?
The time it takes to build a map cache depends on several factors.
To estimate the total time and space on disk for a map cache, we recommend that you first cache a small portion of your map. For example, you can use a polygon feature class covering a tenth of the total area to cache to limit the map caching process. This is an optional parameter of the Manage Map Server Cache Tiles geoprocessing tool. Once you know how much time and space a tenth of your map takes, you can extrapolate the time and space required for the entire map.
This is a rough estimate, because the number of features involved in each map tile will vary across your geography, and that affects the final size of the map tiles and the time it takes to create them. You should be conservative when estimating time and disk space.
What is on-demand caching?
By default, ArcGIS Server will cache the entire geography of your map as defined by the full extent of your map document. Often, this geography is substantially bigger than the area that your users will be accessing, especially at the most detailed levels.
For example, take a country like Italy. The rectangular extent of Italy includes many areas in France, Croatia, Slovenia, and Tunisia, but most important, most of the map depicts the Mediterranean and Adriatic seas. There is no need to cache the Mediterranean Sea at 1:10,000 scale. Because you never want to cache more than you need to, you can use the shape of Italy to restrict the creation of map tiles to the landmass of Italy. This will cut the time required for caching by at least a third.
In ArcGIS Server 9.3, you do not need to build the entire map cache before starting a map service. If you enable on-demand caching for your map service, map tiles will be created as users visit noncached areas for the first time. Although the first user will have to wait for the map tiles to be created, subsequent users will quickly access the cached map tiles.
On-demand caching is a powerful concept that will save you time when building the map cache, but it should not be overused. Use it for those areas that rarely will be visited, not as a means to populate your entire map cache. Map caching is an investment. While it may take some time, it will always be worthwhile if well planned.
What is the difference between a fused cache and a multilayer cache?
Fused cache means that the map tiles in your map cache show all the visible layers in your map document. A multilayer cache creates a separate map tile for each layer in your map. Multilayer caches allow your users to toggle layers on and off in your map, just as you would do in ArcMap.
The multilayer cache option works best for ArcGIS Desktop clients provided that you have an optimal network connection between the map service and the client. A multilayer cache is generally not adequate for Web browser-based clients for two reasons: usability and performance.
For Web mapping applications, the number of toggable layers should be reduced as much as possible because this greatly simplifies the usability of the application. Creating multiple fused caches is a good way to logically group together layers in your map document that make sense to be toggled together.
If you think about it, the real problem is not the number of toggable layers that your map service exposes but the number of layers that end users can potentially turn visible at the same time. As this number increases, the performance of your application is penalized, because many map tiles need to be downloaded to the client machine. Unless your application runs on a fairly good network, you will see significant impact on performance when looking at more than five or six different map caches at the same time.
It is recommended that the number of layers that can be made visible at the same time be limited through the user interface and that layers be logically aggregated when creating fused map caches.
If a user workflow really needs a great level of granularity over the visibility of layers, you might need to combine map caches and dynamic services or use other techniques such as graphics.
Is there anything I need to consider before building a cache that will overlay another basemap cached service?
When overlaying caches, consider the tiling scheme of your cache and how it matches the tiling scheme of the basemap cache. How closely tiling schemes match depends on where the basemap cache originates and where the cache will be consumed. Use these steps to guide you.
The tiling scheme consists of these four properties: tile origin, tile size, scale, and dots per inch (or DPI, which refers to the resolution of the cache tiles that the server will generate).
In addition, avoid scale level gaps for best performance. This is explained in the ArcGIS Server 9.3 help documentation topic "Overlaying map caches in the .NET Web ADF." Also, when selecting image format, remember that JPEG images cannot be made transparent and, therefore, cannot overlay other services.
If I choose to cache data that changes, what workflows are suggested to keep my cache current?
With ArcGIS Server 9.3, you have many options for updating a cache. A map cache can be updated by map extent, feature class extent, and specific tile.
Feature class extent
Depending on how frequently your data changes, you may decide to automate the update procedure using the Manage Map Server Cache Tiles tool. For more information on updating map caches, search the ArcGIS Server 9.3 Online help for the topic "Update Map Server Cache (Server)." This topic contains a sample script for updating a fused map cache that can be used with the Windows Task Scheduler.
I want to implement a map cache but it isn't practical to cache my entire geographic region. How do I create a partial cache so that I am able to quickly satisfy the needs of my users?
With ArcGIS Server 9.3, you can create a partial cache using a combination of precached tiles and tiles created on demand. First, precache the areas that your users are likely to visit immediately. You can define this area by feature class or cache by custom full extent (both described in previous answers in this article).
For areas that are less in demand, use on-demand caching. These tiles will be created as they are requested and added to your cache on the server. The first visitor to an area must wait for the tiles to be created, but subsequent visitors to that area use the tiles created on the server by the first visitor. The on-demand option is not enabled by default but can be enabled in the Caching tab of the Map Service Properties dialog box.
See the free Web training seminar Implementing and Optimizing ArcGIS Server Map Caches at www.esri.com/training.