Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Redis template no clear cache

$
0
0

The caching still after 24 seconds, I tried to set expire on each saves caching but I want to be generic in the configuration

   @Bean    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {        RedisTemplate<String, Object> template = new RedisTemplate<>();        template.setConnectionFactory(connectionFactory);        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = initJackson2JsonRedisSerializer();        RedisSerializer<String> stringSerializer = new StringRedisSerializer();        template.setKeySerializer(stringSerializer);        template.setHashKeySerializer(stringSerializer);        template.setValueSerializer(jackson2JsonRedisSerializer);        template.setHashValueSerializer(jackson2JsonRedisSerializer);        template.setDefaultSerializer(jackson2JsonRedisSerializer);        template.afterPropertiesSet();        template.expire(CacheType.EDITORIAL_CACHE.name(), 24, TimeUnit.SECONDS);        template.expire(CacheType.S3_CACHE.name(), 24, TimeUnit.SECONDS);        return template;    }

Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>