문제
getUnivApplyInfoDetail은 결과를 univApplyInfo:{id} 키로 86400초간 캐싱하지만, 어드민 update/delete 시 eviction 대상에서 누락되어 있습니다.
현재 updateUnivApplyInfo·deleteUnivApplyInfo의 @DefaultCacheOut은 아래 두 키만 evict합니다.
univApplyInfoTextSearch* (prefix)
university:recommend:general* (prefix)
univApplyInfo:{id} 키는 포함되지 않아, 어드민이 항목을 수정해도 상세 페이지는 최대 24시간 동안 변경 전 데이터를 반환합니다.
원인
@DefaultCacheOut의 prefix 플래그가 key[] 배열 전체에 단일 적용되므로, prefix eviction(검색·추천)과 exact eviction(univApplyInfo:{id})을 하나의 어노테이션에서 혼용할 수 없습니다.
해결 방안
@DefaultCacheOut을 반복 가능한(Repeatable) 어노테이션으로 변경하여, prefix/exact eviction을 분리 선언합니다.
DefaultCacheOut에 @Repeatable(DefaultCacheOuts.class) 추가
- 컨테이너 어노테이션
DefaultCacheOuts.java 생성
CachingAspect에 @DefaultCacheOuts 처리 로직 추가
updateUnivApplyInfo·deleteUnivApplyInfo에 두 번째 @DefaultCacheOut 추가
@DefaultCacheOut(
key = {"univApplyInfoTextSearch", "university:recommend:general"},
cacheManager = "customCacheManager",
prefix = true
)
@DefaultCacheOut(
key = {"univApplyInfo:{0}"},
cacheManager = "customCacheManager"
)
public AdminUnivApplyInfoResponse updateUnivApplyInfo(Long id, ...) { ... }
영향 범위
AdminUnivApplyInfoService.updateUnivApplyInfo
AdminUnivApplyInfoService.deleteUnivApplyInfo
CachingAspect, DefaultCacheOut, 신규 DefaultCacheOuts
문제
getUnivApplyInfoDetail은 결과를univApplyInfo:{id}키로 86400초간 캐싱하지만, 어드민 update/delete 시 eviction 대상에서 누락되어 있습니다.현재
updateUnivApplyInfo·deleteUnivApplyInfo의@DefaultCacheOut은 아래 두 키만 evict합니다.univApplyInfoTextSearch*(prefix)university:recommend:general*(prefix)univApplyInfo:{id}키는 포함되지 않아, 어드민이 항목을 수정해도 상세 페이지는 최대 24시간 동안 변경 전 데이터를 반환합니다.원인
@DefaultCacheOut의prefix플래그가key[]배열 전체에 단일 적용되므로, prefix eviction(검색·추천)과 exact eviction(univApplyInfo:{id})을 하나의 어노테이션에서 혼용할 수 없습니다.해결 방안
@DefaultCacheOut을 반복 가능한(Repeatable) 어노테이션으로 변경하여, prefix/exact eviction을 분리 선언합니다.DefaultCacheOut에@Repeatable(DefaultCacheOuts.class)추가DefaultCacheOuts.java생성CachingAspect에@DefaultCacheOuts처리 로직 추가updateUnivApplyInfo·deleteUnivApplyInfo에 두 번째@DefaultCacheOut추가영향 범위
AdminUnivApplyInfoService.updateUnivApplyInfoAdminUnivApplyInfoService.deleteUnivApplyInfoCachingAspect,DefaultCacheOut, 신규DefaultCacheOuts