-
Notifications
You must be signed in to change notification settings - Fork 1
Cacheable 활성화 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cacheable 활성화 #43
Conversation
dependency submission code removed
merging main retry
WalkthroughThe changes enable Spring caching for several service methods by uncommenting previously commented-out Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Service
participant Cache
participant Repository
Client->>Service: Call method (e.g., getCafeteriaList)
Service->>Cache: Check cache for key
alt Cache hit
Cache-->>Service: Return cached result
Service-->>Client: Return result
else Cache miss
Service->>Repository: Fetch data
Repository-->>Service: Return data
Service->>Cache: Store result in cache
Service-->>Client: Return result
end
Possibly related PRs
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/com/example/Jinus/service/cafeteria/CacheService.java (1)
27-41: Consider using @Cacheable for getDietList methodThe
getDietListmethod is using a manual Redis caching implementation with custom TTL calculation based on midnight expiration. Consider whether this could be replaced with a Spring@Cacheableannotation with a custom key generator and TTL configuration to maintain consistency with other caching implementations.src/main/java/com/example/Jinus/service/cafeteria/CampusService.java (1)
28-30: Consider adding cache for getCampusList methodThe
getCampusListmethod returns a list of campuses, but unlike other methods, it doesn't have a@Cacheableannotation. Since campus data is likely to change infrequently, consider adding caching to this method as well for consistency and performance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/com/example/Jinus/service/cafeteria/CacheService.java(1 hunks)src/main/java/com/example/Jinus/service/cafeteria/CafeteriaQueryService.java(1 hunks)src/main/java/com/example/Jinus/service/cafeteria/CampusService.java(2 hunks)
🔇 Additional comments (5)
src/main/java/com/example/Jinus/service/cafeteria/CafeteriaQueryService.java (2)
15-19: Caching activated for getCafeteriaId methodThe
@Cacheableannotation is now enabled for thegetCafeteriaIdmethod with appropriate configuration:
- Uses "cafeteriaId" as the cache name
- Creates a composite key from cafeteria name and campus ID
- Prevents caching when the result is -1 (not found case)
This is a good practice for query methods that are frequently called with the same parameters.
24-27: Caching activated for getImgUrl methodThe
@Cacheableannotation is now enabled for thegetImgUrlmethod with appropriate configuration:
- Uses "cafeteriaUrl" as the cache name
- Uses cafeteria ID as the cache key
- Utilizes the same cache manager as other methods
This will improve performance for frequently accessed image URLs.
src/main/java/com/example/Jinus/service/cafeteria/CacheService.java (1)
58-61: Caching activated for getCafeteriaList methodThe
@Cacheableannotation is now enabled for thegetCafeteriaListmethod:
- Uses "cafeteriaList" as the cache name
- Uses campus ID as the cache key
- Uses the same "contentCacheManager" as other services
This is consistent with the caching approach used in other services and should improve performance for cafeteria list retrieval.
src/main/java/com/example/Jinus/service/cafeteria/CampusService.java (2)
18-21: Caching activated for getUserCampusName methodThe
@Cacheableannotation is now enabled for thegetUserCampusNamemethod:
- Uses "campusId" as the cache name
- Uses campus ID as the cache key
- Uses the standard "contentCacheManager"
This will improve performance for frequently accessed campus name lookups.
32-35: Caching activated for getCampusId methodThe
@Cacheableannotation is now enabled for thegetCampusIdmethod:
- Uses "campusName" as the cache name
- Uses campus name as the cache key
- Uses the standard "contentCacheManager"
This will improve performance for campus ID lookups and is consistent with other caching implementations.
redis 캐시 db 주소 변경
Summary by CodeRabbit