Turn off cache?

2344
1
Jump to solution
10-05-2015 01:15 PM
JoeMcCollum
New Contributor

Hi, we've got an in-house gis server. 

I bring in a layer but can't see it in Arcmap.

When I go into the table of contents and uncheck "Enable Cache View Mode" then I can see it.

I suppose I have to either do something to set up the cache, or else disable the cache view mode.  I would like to do that programmatically.

This doesn't seem to work:

Dim pEnumLayer As IEnumLayer

pEnumLayer = cmap.Layers

pEnumLayer.Reset()

Dim player As ILayer

  player = pEnumLayer.Next

Do While Not player Is Nothing

   player.cached = false

   Msgbox(str(player.cached))

   'for some reason this is returning "4"

   player = pEnumLayer.Next

Loop

When this code is run the layer remains with "Enable Cache View Mode" checked.

0 Kudos
1 Solution

Accepted Solutions
ModyBuchbinder
Esri Regular Contributor

Hi

You did not write it but I understand it is image service (this is the service that has this button).

If it is unable by default it means you define the cache but did not build it.

Building the cache can take time, use the Manage Map Server Cache Tiles GP tools to build it.

You can republish the service without cache definition so it will not use it by default.

The way to do it using code in your situation is IImageServerLayer3.EnableCacheViewMode

Have fun

Mody

View solution in original post

1 Reply
ModyBuchbinder
Esri Regular Contributor

Hi

You did not write it but I understand it is image service (this is the service that has this button).

If it is unable by default it means you define the cache but did not build it.

Building the cache can take time, use the Manage Map Server Cache Tiles GP tools to build it.

You can republish the service without cache definition so it will not use it by default.

The way to do it using code in your situation is IImageServerLayer3.EnableCacheViewMode

Have fun

Mody