ArcGIS Server Multi Layer Cache

We have a high visibility site getting ready to launch - and we have been wondering about an issue for a while now. Up until now, it took a backseat to other issues while in development. But now that its officially launch time, we decided to dig a bit deeper and figure out how to get every last bit of performance out of the app.

The site is using a multi layer cache. This site uses lots and lots of different layers. They are also nationwide - and then all the way down to zipcode level. The application needs to be able to turn on and off lots of different layers and switch between many map services. For this reason, the best option for us was to use the Multi Layer Cache. The data itself is pretty static, so caching was the way to go here. If we were to try and draw this dynamically, it would quickly overwhelm our servers as this is a very high visibility site and will be taking lots of hits.

So, when we got to actually writing the application, we used (surprise surprise) the ArcGIS Server JavaScript API. Using the oh-so-cool REST services explorer (wouldn't this have been nice with ArcIMS?), the map service shows up as Single Fused Map Cache: false. No mention of a Multi Layer cache. So, the only way to utilize these multilayer cache services in our application is via ArcGISDynamicMapServiceLayer.

So, what does that mean? Is this just a bug? Is there a reason to cache these at all? Well, the answer is yes. While the JS API still consumes these services as a ArcGISDynamicMapServiceLayer, the server component, when assembling the map, does not have to re-render the map each time. It simply assembles the tiles on the server and then sends back the completed image. While this is not exactly ideal, or what I would have expected, its much better than the server having to render the map on each request and then export/send it to the client.

We did some informal testing and using the multilayer cache dynamic request vs pure dynamic request and the speed gains were quite significant.

Moral of the story? If you have a need for a multilayer cache, use it. There are huge speed advantages to using it over a pure dynamic layer. If you can get away with a fused cache, that is obviously the better choice, because it will stream the pre rendered tiles instead of a map image.

I have heard from some folks at ESRI that the upcoming js api v1.3, we may have some other ways of doing things and taking better advantage of these types of caches. We'll be sure to blog about this further when its out.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Candace's Gravatar Nice post!

Did you have any transparency problems using the multi layer cache? I am using the REST API and am fusing 2 dynamic Map Service Layers. The one that is a multi layer cache is still showing the background even though the default is transparent = true. hmm.
# Posted By Candace | 5/12/09 10:21 PM
Kudos's Gravatar It explains all!!
great post
# Posted By Kudos | 10/2/09 2:14 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner