Interface ResetStrategy
public interface ResetStrategy
Interface defining a strategy for resetting the cache.
- Since:
- 4.1
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ResetStrategyclear()Default reset strategy iterating through each registeredRedisCacheand callingRedisCache.clear().static ResetStrategyflushDb()Flush the Redis database using theFLUSHDBcommand.static ResetStrategyReset strategy iterating through each registeredRedisCacheand callingRedisCache.invalidate().
-
Method Details
-
clear
Default reset strategy iterating through each registeredRedisCacheand callingRedisCache.clear(). Actual clearing may be performed in an asynchronous or deferred fashion, with subsequent lookups possibly still seeing the entries. -
invalidate
Reset strategy iterating through each registeredRedisCacheand callingRedisCache.invalidate(). This strategy expects all entries to be immediately invisible for subsequent lookups. -
flushDb
Flush the Redis database using theFLUSHDBcommand. This is the fastest way to reset all caches, but it will also wipe all keys in the database, which may not be desirable if the database holds keys that are not used by a cache or the database is shared with other applications keys. This strategy does not acquire or wait for any locks to be released.
-