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.

  • 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.

  • 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:


  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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