Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to script the process to clear the rest cache on the \rest\admin page after I do a start/stop with the AGSSOM.exe provided on arcscripts. Is it typical to have to clear the cache after creating new services or start/stop-ing services. We seem to have to. Thanks.

share|improve this question
Actually we will be adding new updating the feature class that the mapping service points to. – Justin Apr 7 '11 at 17:07

You can build the URL using these instructions on the ArcGIS Server Blog then simply call the URL from your script.

share|improve this answer
We are not at 10 yet but this looks nice. Thanks. – Justin Apr 7 '11 at 17:15

You should clear the cache if you create or remove a service. However you should not need to when you just start or stop a service. Here is the esri documentation:

share|improve this answer
You should clear the cache if you've updated the MXD between stop and start. – mwalker Apr 7 '11 at 15:40
We are updating the feature class that the mxd sources. Currently we have the cache to be cleared every 30 min. I read that this may slow down services. Now that I think about it the reason we were clearing so often is because someone said the cache gets full due to requests but that doesn't seem to square since the cache is based on sources and settings rather than requests to the endpoints. Perhaps I can have it clear at a set time each day..after we run our scripts to update. Any thoughts are most welcome. – Justin Apr 7 '11 at 17:13

You should need to clear the cache only if you are creating new services or altering existing ones. For example if you are starting and stopping a service because you have altered the underlying MXD or MSD you would need to clear the cache for those changes to take effect. This needs to be done even for seemingly minor changes such as enabling or disabling fields in the MXD.

However if you are restarting the service because you had a problem with it or you are shutting down the SOM and SOC because you are doing your compress and want to remove all database locks then it is not necessary because the REST service directory is not changing.

Ultimately, don't script the cache clearing process because it is not something you should have to do on a regular basis. You should do it manually as a part of the service creation/editing process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.