WARNING: Version 6.1 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
The Clear Cache API evicts users from the user cache. You can completely clear the cache or evict specific users.
POST _xpack/security/realm/<realms>/_clear_cache
POST _xpack/security/realm/<realms>/_clear_cache?usernames=<usernames>
User credentials are cached in memory on each node to avoid connecting to a remote authentication service or hitting the disk for every incoming request. There are realm settings that you can use to configure the user cache. For more information, see Controlling the User Cache.
To evict roles from the role cache, see the Clear Roles Cache API.
-
realms
(required) - (list) A comma-separated list of the realms to clear.
-
usernames
- (list) A comma-separated list of the users to clear from the cache. If you do not specify this parameter, the API evicts all users from the user cache.
For example, to evict all users cached by the file
realm:
POST _xpack/security/realm/default_file/_clear_cache
To evict selected users, specify the usernames
parameter:
POST _xpack/security/realm/default_file/_clear_cache?usernames=rdeniro,alpacino
To clear the caches for multiple realms, specify the realms as a comma-delimited list:
POST _xpack/security/realm/default_file,ldap1/_clear_cache