[#70] 중복 조회 로직에 로컬 캐시 도입 #71

Merged
pricelees merged 4 commits from refactor/#70 into main 2025-10-17 10:47:15 +00:00
4 changed files with 12 additions and 0 deletions
Showing only changes of commit cf90f0fb91 - Show all commits

View File

@ -8,6 +8,10 @@ dependencies {
// API docs // API docs
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13")
// Cache
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("com.github.ben-manes.caffeine:caffeine")
// DB // DB
runtimeOnly("com.h2database:h2") runtimeOnly("com.h2database:h2")
runtimeOnly("com.mysql:mysql-connector-j") runtimeOnly("com.mysql:mysql-connector-j")

View File

@ -3,8 +3,10 @@ package com.sangdol.roomescape
import org.springframework.boot.Banner import org.springframework.boot.Banner
import org.springframework.boot.SpringApplication import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.cache.annotation.EnableCaching
import java.util.* import java.util.*
@EnableCaching
@SpringBootApplication( @SpringBootApplication(
scanBasePackages = ["com.sangdol.roomescape", "com.sangdol.common"] scanBasePackages = ["com.sangdol.roomescape", "com.sangdol.common"]
) )

View File

@ -16,6 +16,9 @@ spring:
jdbc: jdbc:
batch_size: ${JDBC_BATCH_SIZE:100} batch_size: ${JDBC_BATCH_SIZE:100}
order_inserts: true order_inserts: true
cache:
type: caffeine
cache-names: ${CACHE_NAMES:theme-details}
management: management:
endpoints: endpoints:

View File

@ -18,6 +18,9 @@ spring:
init: init:
mode: always mode: always
schema-locations: classpath:schema/schema-mysql.sql schema-locations: classpath:schema/schema-mysql.sql
cache:
type: caffeine
cache-names: ${CACHE_NAMES:theme-details}
security: security:
jwt: jwt: