FRAMES | NO FRAMES Description | Parameters | Response
Clear REST Cache (Operation)
URL http://<admin-url>/system/handlers/rest/cache/clear

Note: From 10.1 onwards ArcGIS Server automatically updates the REST cache when you add, update or remove services and folders. This eliminates the need for clearing REST cache manually when a change is made to the services or folders.

However if you need to clear the cache manually, use the clear cache operation supported by the ArcGIS Server's Admin API using the URL shown above. Please inform ESRI Support if there are use cases that require manual clearing of the REST cache.

Description

The clear REST cache operation. This operation explicitly clears the REST API cache immediately.

Clients need a security token to clear the REST cache. You can get a security token by using the Generate Admin Token operation.

The clear REST cache operation supports the following parameters. If the folderName, serviceName and type parameters are not specified, the entire REST cache will be cleared.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
folderName Description: The name of a folder. If only the folderName parameter is specified in the request, cache will be cleared for that folder.

ExamplefolderName=CachedServices
serviceName Description: The service for which REST cache needs to be cleared. When providing a serviceName, also provide type parameter. If the folderName parameter is not set, the service is assumed to be in the root folder. REST cache will be cleared for the specified service and its folder.

ExampleserviceName=WorldElevation
type Description: Type of service.

Exampletype=MapServer

Example Usage.

Example 1: Use security token generated using Generate Admin Token operation to clear the REST cache. This will clear the entire REST cache.

http://<host>/arcgis/admin/system/handlers/rest/cache/clear?token=89dw7r0jfFDKWgDa7bZHVvttqiEv7sX7UnOH1oe_Mz-qqQ6oDg..&f=json

Example 2: Clear cache for a specific service and its folder - for example when a service is stopped.

http://<host>/arcgis/admin/system/handlers/rest/cache/clear?folderName=CachedServices&serviceName=WorldElevation&type=MapServer&token=89dw7r0jfFDKWgDa7bZHVvttqiEv7sX7UnOH1oe_Mz-qqQ6oDg..&f=json

Example 3: Clear a folder cache, for example after a new service is created.

http://<host>/arcgis/admin/system/handlers/rest/cache/clear?folderName=CachedServices&token=89dw7r0jfFDKWgDa7bZHVvttqiEv7sX7UnOH1oe_Mz-qqQ6oDg..&f=json

Example 4: Clear root folder's cache, after a folder is added or removed.

http://<host>/arcgis/admin/system/handlers/rest/cache/clear?folderName=/&token=89dw7r0jfFDKWgDa7bZHVvttqiEv7sX7UnOH1oe_Mz-qqQ6oDg..&f=json

JSON Response Syntax

{
  "success": true //the value will always be true. Failure will result in an error response.
}

JSON Response Example

{
  "success": true
}