private void scanEntries() { for (String key : cache.keySet()) { CachedValueWrapper wrapper = cache.get(key); if (wrapper.getRedisCacheAnn().redisFor() == StoreValue) continue; long expiration = RedisCacheUtils.redisExpirationSeconds(key, appContext); long cacheExpiration = cache.getExpiration(key); if (expiration == cacheExpiration) continue; CachedValueWrapper removed = cache.remove(key); if (removed == null) continue; Logger logger = wrapper.getLogger(); logger.debug("invalidate cache {} because of redis refresh seconds changed to {} ", key, expiration); } }