1
0

clear-cache.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. [role="xpack"]
  2. [[security-api-clear-cache]]
  3. === Clear cache API
  4. ++++
  5. <titleabbrev>Clear cache</titleabbrev>
  6. ++++
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-security[Security APIs].
  11. --
  12. Evicts users from the user cache. You can completely clear
  13. the cache or evict specific users.
  14. [[security-api-clear-request]]
  15. ==== {api-request-title}
  16. `POST /_security/realm/<realms>/_clear_cache` +
  17. `POST /_security/realm/<realms>/_clear_cache?usernames=<usernames>`
  18. [[security-api-clear-desc]]
  19. ==== {api-description-title}
  20. User credentials are cached in memory on each node to avoid connecting to a
  21. remote authentication service or hitting the disk for every incoming request.
  22. There are realm settings that you can use to configure the user cache. For more
  23. information, see
  24. <<controlling-user-cache>>.
  25. To evict roles from the role cache, see the
  26. <<security-api-clear-role-cache,Clear roles cache API>>.
  27. To evict privileges from the privilege cache, see the
  28. <<security-api-clear-privilege-cache,Clear privileges cache API>>.
  29. To evict API keys from the API key cache, see the
  30. <<security-api-clear-api-key-cache,Clear API key cache API>>.
  31. [[security-api-clear-path-params]]
  32. ==== {api-path-parms-title}
  33. `<realms>`::
  34. (Required, string)
  35. Comma-separated list of realms to clear. To clear all realms, use `*`. Does not
  36. support other wildcard patterns.
  37. `usernames`::
  38. (Optional, list) A comma-separated list of the users to clear from the cache.
  39. If you do not specify this parameter, the API evicts all users from the user
  40. cache.
  41. [[security-api-clear-example]]
  42. ==== {api-examples-title}
  43. For example, to evict all users cached by the `file` realm:
  44. [source,console]
  45. --------------------------------------------------
  46. POST /_security/realm/default_file/_clear_cache
  47. --------------------------------------------------
  48. To evict selected users, specify the `usernames` parameter:
  49. [source,console]
  50. --------------------------------------------------
  51. POST /_security/realm/default_file/_clear_cache?usernames=rdeniro,alpacino
  52. --------------------------------------------------
  53. To clear the caches for multiple realms, specify the realms as a comma-delimited
  54. list:
  55. [source,console]
  56. ------------------------------------------------------------
  57. POST /_security/realm/default_file,ldap1/_clear_cache
  58. ------------------------------------------------------------
  59. To clear the caches for all realms, use `*`.
  60. [source,console]
  61. ----
  62. POST /_security/realm/*/_clear_cache
  63. ----