shiro only provide the support of ehcache and concurrentHashMap. Here is an implement of redis cache can be used by shiro. Hope it will help you!
Official documentation is located here.
This is a fork of alexxiyang/shiro-redis to fix bugs and add some new features.
-
3.5.0 Add FstSerialize support.
Usage:@Bean public RedisSessionDAO redisSessionDAO() { RedisSessionDAO redisSessionDAO = new RedisSessionDAO(); redisSessionDAO.setRedisManager(redisManager()); // custom session key prefix redisSessionDAO.setKeyPrefix(SESSION_KEY_PREFIX); // custom session value serializer, default is jdk serializer. redisSessionDAO.setValueSerializer(new FstSerializer()); return redisSessionDAO; }
-
3.4.0 Add Lettuce redis client support.
Usage:@Bean public IRedisManager redisManager() { LettuceRedisManager manager = new LettuceRedisManager("127.0.0.1", 6379); manager.setDatabase(Integer.parseInt(database)); // or: LettuceRedisManager manager = LettuceRedisManager.builder().host("127.0.0.1").port(6379).build(); return manager; }