Available map cache properties

There are two steps to making a map cache:

  1. Set cache properties.
  2. Create tiles.

This topic explains the available map cache properties. See Strategies for creating map cache tiles for more about creating the tiles.

Accessing the cache properties

The Caching tab of the Service Properties is the place where you can set cache properties. These topics have instructions on how to get to the Caching tab:

Once you open the Caching tab, you first need to choose the option to draw the map service Using tiles from a cache that you will define below. If you choose to draw Dynamically from the data, the server will draw the map each time, and the map service will not use any cached tiles you have created.

The remainder of this topic explains the settings available on the Caching tab. Once you start creating the cache, you can't change these options unless you delete the existing cache and start over. For this reason, it's important to plan the tiling scheme and other properties for your cache ahead of time.

When you've finished setting the cache properties, click the Create Tiles button (ArcCatalog only) to start creating tiles, or launch the Manage Map Server Cache Tiles geoprocessing tool.

The tiling scheme

The tiling scheme includes the scale levels, tile dimensions, and tile origin for the cache. These properties define where tile boundaries will exist and are important to match when overlaying caches in some clients. Other properties, such as image format and antialiasing, are also written into the tiling scheme but do not affect whether the client application can successfully overlay the tiles.

There are several ways you can choose a tiling scheme:

LegacyLegacy:

ArcGIS Online previously used a tiling scheme based on the WGS 1984 geographic coordinate system that used 512 x 512 pixel tiles. If you have services running that need to use this tiling scheme, you must load it from an existing service or a tiling scheme file.

Scales

If you choose to create your own tiling scheme, you can define the scales yourself or allow ArcGIS Server to suggest some scales for you.

When you choose the Suggest option, the dialog box asks how many scales you want, then the software picks levels that have been increased or decreased by a power of 2 from 1:1,000,000 starting with the level closest to the extent of the source map document. For example, if the source map document has an extent of 1:121,000,000, and three scale levels are defined, ArcGIS Server will suggest scale levels at

  • 1:128,000,000
  • 1:64,000,000
  • 1:32,000,000

In general, you should limit the number of suggested scales you request to about 20 or fewer.

Once you're familiar with the cache creation process, it's best to pick your own scale levels instead of asking the software to suggest scales for you. If possible, you should even pick the scales before you start designing your map. That way, you can design your map to look good at each of the scales.

A simple way to pick a set of scales is to determine the closest scale at which your users will need to view the map, then double the scale's denominator until you reach a scale that would contain your entire area of interest in just one or two tiles. For example, if you were designing a tiling scheme for a city, and the closest scale at which someone should view your map is 1:2,400, your scales could be 1:2,400; 1:4,800; 1:9,600; 1:19,200; 1:38,400, until you reached a scale that would cause the entire city to be visible on your computer screen at once.

Storage settings

You can choose whether to group your tiles for more efficient storage and mobility or store each tile as a single file. These are the storage options:

  • In Compact format, each file in the cache contains a bundle of tiles. The bundles are 128 tiles wide by 128 tiles high, containing a maximum of 16,384 tiles. Compact caches copy much faster than exploded caches, and they take less space on disk.
  • In Exploded format, each tile is stored as a file on disk. This makes it easier to see the tiles as they're added to your cache; however, it results in larger caches that take longer to create and can be cumbersome to copy.

The enormous number of files and folders in the cache can sometimes cause inefficiencies in copying utilities, including Windows Copy/Paste. For this reason, compact caches greatly reduce cache copying time. If you have an automatic cache update workflow that creates tiles on a staging server and copies them to a production server, it's recommended that you use compact caches. Additionally, if you have limited disk space available, you should use compact caches.

Dive-inDive-in:

Compact caches are stored in .bundle files. ArcSOC.exe processes divide up the caching work by bundles, meaning only one ArcSOC.exe file can work on a bundle at a time. Each bundle has a corresponding .bundlx file, which keeps an index of each tile's position within the bundle.

While the cache is being created, you may also see .lock and .done files. The .lock files are the server's way of keeping track of which bundles are currently being created; the presence of a .lock file doesn't mean that the bundle is inaccessible to clients. Similarly, the .done file is the server's way of understanding which bundles have finished. All the .lock and .done files should go away when the caching job has finished.

Tiling scheme origin

The tiling scheme origin is the upper left corner of the tiling scheme grid. The origin does not necessarily represent the point at which tiles begin to be created; that happens when the full extent of the map is reached. Using a common tiling scheme origin for your caches ensures that your caches can overlay each other in Web applications.

Illustration of tiling scheme origin and tiling scheme grid

In most cases, you should keep the default tiling scheme origin chosen by the software. The default is the upper left point of the coordinate reference defined by the map document. If no coordinate reference is defined in the map document, the upper left of the two times the maximum of the union of extents of all the layers in the map is used.

If you change the tiling scheme origin to something other than the default, be aware that tiles can be created only in the map area to the lower right of the tiling scheme origin. If you want to cache only a certain area of your map, creating tiles based on a bounding rectangle or feature class are better options than changing the tiling scheme origin.

Tile width and height

The default tile width and height is 256 pixels. You can choose any width and height that is a power of 2, but it's recommended that you use 128, 256, or 512. If you are building a cache that will overlay another cache, be sure to use the same tile width and height for both caches.

Choosing a smaller tile width and height may improve performance of the application requesting tiles from the cache, as less data will need to be transferred. However, with exploded caches, a smaller tile size results in a larger cache size and longer creation time. Because the default Windows disk block size is 4 kilobytes (K), small tiles that may only be 1K in size will actually use 4K of disk space. A larger tile might be 4K in size and fit perfectly in a 4K block. Therefore, four 1K tiles use 16K of space on disk, whereas the single 4K tile covering the same area only uses 4K. With the large numbers of files in an exploded cache, this difference can become significant.

Illustration of recommended tile widths and heights

Image format

This setting determines what output image format the map service will use when it creates the tiles. Your choice of image format is important, because it determines the size on disk of the tiles, the image quality, and the ability to make the tile background transparent.

The default image format is PNG 8, but you may often need to change this based on the type of map you are creating. Below is a summary of the available image formats and their appropriate uses.

  • PNG8—Use PNG 8 for overlay services that need to have a transparent background, such as roads and boundaries. PNG 8 creates tiles of very small size on disk with no loss of information.

    Do not use PNG 8 if your map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and antialiasing can easily push your map over 256 colors. Even symbols such as highway shields may have subtle antialiasing around the edges that unexpectedly adds colors to your map.

  • PNG24—You can use PNG 24 for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG 8). Do not use PNG 24 if your tiles will be viewed in Internet Explorer version 6 or previous.
  • PNG32—Use PNG 32 for overlay services, such as roads and boundaries, that have more than 256 colors. PNG 32 is an especially good choice for MSD-based overlay services that have antialiasing enabled on lines or text. PNG 32 creates larger tiles on disk than PNG 24, but the tiles are fully supported in all browsers.
  • JPEG—Use this format for basemap services that have large color variation and do not need to have a transparent background. For example, raster imagery and very detailed vector basemaps tend to work well with JPEG.

    JPEG is a lossy image format. It attempts to selectively remove data without affecting the appearance of the image. This can cause very small tile sizes on disk, but if your map contains vector linework or labels, it may produce too much noise or blurry area around the lines. If this is the case, you can attempt to raise the Compression value from the default of 75. A higher value, such as 90, may balance an acceptable quality of linework with the small tile size benefit of the JPEG.

    It's up to you to decide what image quality you consider acceptable. If you are willing to accept a minor amount of noise in the images, you may save large amounts of disk space by choosing JPEG. The smaller tile size also means the browser can download the tiles faster.

  • Mixed—A Mixed cache uses JPEG in the center of the cache with PNG 32 on the edge of the cache. Use the mixed mode when you want to cleanly overlay raster caches on other layers.

    When a mixed cache is created, PNG 32 tiles are created anywhere that transparency is detected (in other words, anywhere that the data frame background is visible). The rest of the tiles are built using JPEG. This keeps the average file size down while providing you with a clean overlay on top of other caches. If you do not use the mixed mode cache in this scenario, you will see a nontransparent "collar" around the periphery of your image where it overlaps the other cache.

    NoteNote:

    Mixed format caches are not supported for viewing in Esri client applications (such as ArcMap or the Web ADF) prior to ArcGIS 10.0.

Before committing to an image format for a large cache, build a small cache of a representative area of your map and examine the tile quality and performance in a test application. If you'll be working with multiple caches, build a small test cache for each and add them to a test application to make sure they overlay as expected. This will allow you to make adjustments before you create the entire cache.

To make a small test cache, use the editing tools in ArcGIS Desktop to create a new feature class consisting of a small rectangle around the area you want to test. Then use the option at the bottom of the Manage Map Server Cache Tiles tool that allows you to create tiles based on the boundary of a feature class. Browse to the feature class containing your test area and create the tiles.

Antialiasing

Antialiasing is a graphics technique that blends foreground and background pixels near edges to trick the eye into seeing smoother borders. You can apply antialiasing to your map services to get higher-quality line and label appearance. As a server administrator, you must decide whether the performance hit of the antialiasing is worth the improved visual quality.

Antialiasing works differently depending on whether the map service is based on an MXD file (ArcMap document) or an MSD file (map service definition). To get the best quality and performance, it's recommended that you use antialiasing with MSD-based services, using the PNG 32 image format.

The Map Service Publishing toolbar in ArcMap allows you to apply different levels of antialiasing to lines and text for MSD-based services. The higher the quality of antialiasing you choose, the slower the map will draw. You can use the Preview button on the toolbar to get an idea of the appearance and draw times with different levels of antialiasing.

If you're using an MXD-based service, ArcGIS Server performs the antialiasing by downsampling a large map area before cutting it into the smaller-size tile specified in the tiling scheme. With this technique, the data frame background color contributes to the color of the antialiased features. If your vector-based cache will overlay raster imagery, change the data frame background to a darker color that is unlikely to appear in the map before you start creating the cache. Some software tools will allow you to find the average color within a given image, and this can be a good color value to use for your data frame background.

Screen shot comparing differences in graphics between antialiasing and no antialiasing

DPI

Dots per inch (DPI) refers to the resolution of the cache tiles that the server will generate. DPI depends on the user's screen resolution (for example, 1024x768) and physical size (for example, 19" diagonal). DPI can vary widely on client machines because of big screens (which lower DPI) and higher-resolution screens and graphics cards (which increase DPI with higher settings). If clients will frequently be printing maps that include your cached layer, you may find it helpful to raise the DPI beyond the default, but be aware that this will increase the size of the files in the cache.

When choosing a DPI setting, the default value of 96 is usually sufficient unless you are working primarily on a network where the majority of your client machines have a different DPI.

Advanced options (cache type)

Clicking the Advanced Options button presents you with the option of choosing a Fused or Multilayer cache. A fused cache includes all the layers in the map in one fused image. The layers must be turned on and off together.

In contrast, a multilayer cache consists of a set of cached images for each layer. When you display the map, the server must still blend together the tiles from each layer. The more layers you have in your multilayer cache, the longer the blending will take. If you attempt to use a multilayer cache with too many layers, you may lose the performance benefit of the cache. Additionally, the cache takes longer to create because each layer has to be rendered at all scale levels over the extent of the cache.

Use fused caches whenever possible. If you need to be able to turn layers on and off, consider overlaying multiple fused caches instead of using a multilayer cache. To do this, determine some logical groups of layers from your original map document and add each group to its own map document. Publish a service for each map document, then create a fused cache for each one. You can then overlay these fused caches in Web applications or in ArcMap.

Tip: If you use the above technique of overlaying fused caches, be sure to use the same tiling scheme for each cache. Also, add the fused caches directly into the client application for best performance. Avoid embedding one or more services within a service.

Below are some more notes on multilayer cache behavior:

  • ArcMap is the recommended client for working with a multilayer cache. Using a multilayer cache in a Web application provides little or no advantage over using a noncached map service.
  • Multilayer caches are not available with MSD-based services.
  • Group layers are treated as one layer in a multilayer cache. You cannot turn layers on and off within the group layer.

Creating tiles on demand

The Caching tab contains a Create tiles on demand check box. When this box is checked, tiles for previously uncached areas will be added to the cache when they are first requested by a client.

Learn more about when to use on-demand caching.

Performance Tip: When you have enabled on-demand caching, your client applications will achieve better performance using an ArcGIS Server Internet connection as opposed to an ArcGIS Server local connection.

About the server cache directory

The server cache directory is the folder on disk where your cache tiles are stored. One server cache directory can hold multiple caches; however, if you want, you can add more than one server cache directory to your server. On the Caching tab, you can choose which server cache directory will be used to store your cache.

When you install all the components of ArcGIS Server on just one machine, a server cache directory is created for you. (The default location is C:\arcgisserver\arcgiscache.) A virtual directory that references this location also gets created.

If you install the components of ArcGIS Server across multiple machines, you need to configure the server cache directory and its associated virtual directory yourself. For further reading, see Creating a server directory and Configuring a multiple-machine deployment. Be sure to give the SOC account Write access to the server cache directory so that ArcGIS Server can successfully place the tiles in the directory. You can optionally remove Write access when you finish creating your caches.

Folder structure in the server cache directory

You can open the server cache directory in Windows Explorer to examine the cache tiles and tiling scheme file conf.xml. Another file conf.cdi contains the default extent information of the service and is required for viewing caches as raster datasets in ArcGIS Desktop.

The tiles are organized into a directory hierarchy. The top-level directory has the same name as the map service unless the service was created in a GIS server folder. If the map service is in a folder, the top-level directory is named <folder name>_<map service name>.

CautionCaution:

If you change the service name or map data frame name, you'll need to manually rename the cache folder to match.

Under the top-level directory, you'll find a subdirectory for the particular data frame in the map being cached. Next, depending on whether you've created a single fused cache or a multilayer cache, you'll find either a single subdirectory, _alllayers, or multiple subdirectories, each named after the specific layer being cached in the multilayer cache.

Within each layer subdirectory, you'll find subdirectories for each level of detail. The structure of these level-of-detail subdirectories varies depending on whether you're using compact storage format or exploded storage format.

  • If you're using the compact cache format, you'll see bundle files immediately within the level folders. These bundle files contain the tiles.
  • If you're using the exploded cache format, you'll see subdirectories for each tile row, and finally, the actual image files that represent a particular column in the row.

A server cache directory can also contain a GlobeCache folder, which contains all the globe caches stored in the server cache directory.


11/18/2013