feat: 주요 조회 API 레디스 캐싱 설정 추가#111
Merged
Merged
Conversation
✅ 테스트 결과 for PRBuild: success 🧪 테스트 실행 with Gradle |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 29 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+47
| @Cacheable( | ||
| cacheNames = CacheNames.AUCTION_HISTORY_SEARCH, | ||
| key = | ||
| "#pageRequestDto.page() + ':'" | ||
| + " + #pageRequestDto.size() + ':'" | ||
| + " + (#pageRequestDto.sortBy() != null ? #pageRequestDto.sortBy().fieldName : 'dateAuctionBuy') + ':'" | ||
| + " + (#pageRequestDto.direction() != null ? #pageRequestDto.direction().code : 'DESC') + ':'" | ||
| + " + (#requestDto.itemName() ?: '') + ':'" | ||
| + " + (#requestDto.isExactItemName() ?: false) + ':'" | ||
| + " + (#requestDto.itemTopCategory() ?: '') + ':'" | ||
| + " + (#requestDto.itemSubCategory() ?: '') + ':'" | ||
| + " + (#requestDto.dateAuctionBuyRequest()?.dateAuctionBuyFrom() ?: '') + ':'" | ||
| + " + (#requestDto.dateAuctionBuyRequest()?.dateAuctionBuyTo() ?: '')", |
There was a problem hiding this comment.
캐시 키에서 #pageRequestDto.page()/size()/sortBy()/direction()의 null 값을 그대로 문자열에 포함하면, 실제 조회는 toPageable()에서 기본값으로 정규화되는데도 요청 형태(null vs 기본값)별로 서로 다른 캐시 엔트리가 생겨 히트율이 떨어집니다. 키를 (#pageRequestDto.page ?: 1), (#pageRequestDto.size ?: 20)처럼 기본값으로 정규화(또는 pageRequestDto.toPageable() 기반으로 키 구성)해 주세요.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 상세 설명
📊 체크리스트