반응형 starter-cache1 Spring Boot에서 Redis를 기본적인 Cache(spring-boot-starter-cache)로 사용하기 의존성 org.springframework.boot spring-boot-starter-data-redis Spring-boot-starter-web 혹은 spring-boot-starter-data-redis을 받으면 Spring-boot-starter-cache에 대한 의존성을 모두 포함하여 받을 수있다. 설정 spring.cache.type: redis spring.redis: host: localhost port: 6379 캐시 사용 기본 사용은 ConcurrentMapCacheManager가 등록되며 인메모리 ConcurrentHashMap으로 캐시 역할을 수행하는 듯 보인다. @Cacheable : 캐시 있으면 가져오고, 없으면 등록 @CachePut : 무조건 등록 // SpEl 문법 사용가.. 2021. 8. 2. 이전 1 다음 728x90 반응형