Interface ResetStrategy


public interface ResetStrategy
Interface defining a strategy for resetting the cache.
Since:
4.1
Author:
Christoph Strobl, Mark Paluch
  • Method Details

    • clear

      static ResetStrategy clear()
      Default reset strategy iterating through each registered RedisCache and calling RedisCache.clear(). Actual clearing may be performed in an asynchronous or deferred fashion, with subsequent lookups possibly still seeing the entries.
    • invalidate

      static ResetStrategy invalidate()
      Reset strategy iterating through each registered RedisCache and calling RedisCache.invalidate(). This strategy expects all entries to be immediately invisible for subsequent lookups.
    • flushDb

      static ResetStrategy flushDb()
      Flush the Redis database using the FLUSHDB command. 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.