News

ArcUser Online


Search ArcUser

 

E-mail to a Friend

Providing the Best User Experience
Answers to questions about map caching for ArcGIS Server

In this article, Bronwyn Agrios, an instructor with Esri Education Services in Redlands, California, answers seven common questions about using and maintaining map caches for ArcGIS Server maps.

This article as a PDF .

How will map caching improve the user experience of my Web applications?

click to enlarge
The request for cache tiles is first sent to the GIS server, then all subsequent requests are handled by the Web server.

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.

  1. The number of map tiles to be created. The extent of the geographic area to be cached and the number of levels of detail determine the number of map tiles to be created. Big areas and many levels of detail mean more map tiles and, hence, more processing time.
  2. The map display performance of the map document to be cached. The faster your original map document is, the faster map tiles will be created.
  3. The number of cores used to create the map cache. You can reduce the time it takes to create a map cache by distributing the map caching process across multiple machines.
  4. Other factors that affect the time and space required for cache creation include map tile size, format, and resolution. The space needed on disk will depend on the number of map tiles as well as their size and format.
four successive screenshots
The structure of the ArcGIS Server map cache on disk

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.

click to enlarge
The option to allow or not allow clients to cache locally is available from the Map Service Properties dialog box on the Caching tab.

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?

click to enlarge
An example of a heterogeneous data sample

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.

click to enlarge
Custom extent enabled in the Full Extent dialog box, available from the Data Frame tab of the data frame properties

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.

  1. Decide which basemap cache you will use. The basemap cache may come from within your organization or a partner organization, ArcGIS Online, Google Maps, or Microsoft Virtual Earth.
  2. Change the coordinate system of the data frame in your map to match the coordinate system used by the basemap cache. For example, ArcGIS Online uses WGS 84. Google Maps and Microsoft Virtual Earth use WGS 84 Web Mercator (which is now available in ArcGIS 9.3).
  3. Design your map in ArcMap to match the scales defined in the basemap cache. You can either import a text file containing scales into the ArcMap scale control or manually enter the scales in the ArcMap scale control. For tiling schemes from your organization or a partner organization, have the original creator of the basemap save the custom scales in the scale control to a text file and send it to you. For other tiling systems, see these resources:
    • ArcGIS Online scales can be found by searching the ArcGIS Server 9.3 Online help topic "Designing a map to overlay ArcGIS Online services."
    • For information on Google Maps and Virtual Earth scales, search the ArcGIS Server 9.3 Online help for the topic "Designing a map to overlay Google Maps or Microsoft Virtual Earth."
    For more information on designing a map for caching, see the training seminar Implementing and Optimizing ArcGIS Server Map Caches accessible from training.esri.com.
  4. Publish your map to ArcGIS Server.
  5. Import the tiling scheme from the basemap cache prior to building the cache.
click to enlarge
Import tiling scheme dialog box, accessible from the Caching tab on the Map Service Properties dialog box

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.

click to enlarge
Changes have been made to the parcel boundaries in this area. If you choose to update by the parcels feature class, the update will be very inefficient as it will re-create many of the tiles over and over.
click to enlarge
Updating by a general area means that the tiles intersecting the update area will only be re-created once.

Map extent
These values are defined by the full extent of the map. To update a specific, known area, use the Custom Full Extent option available from the Data Frame tab of the data frame properties. Only the tiles intersecting this extent will be generated.

Feature class extent
To update by the extent of a feature class, select that option in the Manage Map Server Cache Tiles tool, which can be opened in ArcToolbox or accessed through the Service Properties dialog box. This tool allows you to create, delete, or update tiles in your cache. For best performance, generalize the feature class input. For example, instead of updating an area by the parcel boundary, update by a more general feature class encompassing the change area. You may need to create an arbitrary boundary feature class, or you may already have a boundary that meets your needs.

Specific tiles
Options for updating specific tiles are available from the Manage Map Server Cache Tiles tool. If you know which tiles require updating, you can delete those tiles and use the Re-create Empty Tiles option.

click to enlarge
Create tiles for the populated places in Southern California and allow the tiles for the rest of the region to be created on demand.

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.

Resources

See the free Web training seminar Implementing and Optimizing ArcGIS Server Map Caches at www.esri.com/training.

[an error occurred while processing this directive]