Skip to content

fix: 공개 코스 쓰기 작업 시 관련 캐시 즉시 무효화 - #208

Merged
unam98 merged 1 commit into
mainfrom
fix/public-course-cache-eviction
Jul 29, 2026
Merged

fix: 공개 코스 쓰기 작업 시 관련 캐시 즉시 무효화#208
unam98 merged 1 commit into
mainfrom
fix/public-course-cache-eviction

Conversation

@unam98

@unam98 unam98 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • PublicCourseService의 코스 생성/수정/삭제, CourseService의 코스 삭제(공개 코스 연쇄 삭제 포함) 메서드에 @CacheEvict 추가
  • 대상 캐시: publicCourseTotalPageCount, marathonPublicCourse, recommendPublicCourse (전체 유저 공용 목록이라 allEntries=true로 전체 무효화)

Background

Redis 캐싱(#203) 적용 당시 TTL(1분)만 두고 @CacheEvict를 빠뜨려서, 코스가 추가/삭제/수정돼도 최대 1분 동안 오래된 목록이 그대로 노출되는 상태였음. 카프카 로드맵 검토 중(CDC 기반 캐시 무효화 유스케이스를 살펴보다가) 발견.

Test plan

  • JAVA_HOME을 JDK 19로 지정해 로컬 컴파일 성공 확인 (로컬 기본 JDK 26은 Lombok 비호환이라 컴파일 자체가 안 됨 — 프로젝트와 무관한 환경 이슈)
  • 머지 후 dev에서 코스 생성 → 즉시 목록에 반영되는지 수동 확인

@Cacheable만 있고 @CacheEvict가 없어 코스 생성/수정/삭제 후에도
최대 TTL(1분) 동안 오래된 목록이 그대로 노출되던 문제 수정.
코스 목록은 전체 유저 공용이라 작성자 캐시만이 아니라 allEntries로
전체페이지수/마라톤/추천 캐시를 모두 무효화하도록 함.
@unam98 unam98 self-assigned this Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 553aa322-3842-4f88-bace-fdd5db74a61e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unam98
unam98 merged commit be06b12 into main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants