-
Notifications
You must be signed in to change notification settings - Fork 1
프론트엔드 서버 캐시 삭제 기능 구현 #166
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
프론트엔드 서버 캐시 삭제 기능 구현 #166
Conversation
chosim-dvlpr
left a comment
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.
궁금한 점 하나 남겨두었습니다! 타이밍 맞춰 버튼 눌러보고 싶네용ㅋㅋㅋ
| }; | ||
|
|
||
| // revalidate 1s | ||
| export const TAG_PREFIX = 'wiki/'; |
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.
이 prefix는 새로 추가된 걸까요?!
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.
맞아요. 이것도 가설이긴합니다...!
revalidateTag를 할 때 태그에 해당하는 캐시를 지운다고 합니다. 그래서 앞에 동일한 prefix를 달아두면 전부 무효화가 될 것 같아서 해봤습니닷
ShinjungOh
left a comment
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.
캐시 무효화 좋네요~~ 은근 자주 사용될 것 같아요ㅋㅋ 고생하셨습니다!!
| className="flex w-full items-center gap-3 rounded-lg px-4 py-3 font-pretendard text-sm text-grayscale-700 transition-colors hover:bg-grayscale-100" | ||
| onClick={onClickDeleteCacheButton} | ||
| > | ||
| 캐시 삭제 |
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.
캐시 삭제 버튼의 위치를 로그아웃 위로 올리는 것은 어떨까요?
로그아웃은 최하단에 있는 것이 더 익숙하게 느껴지네요~!
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.
오 좋습니다~~ 올려둘게요!
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.
issue
구현 사항
프론트엔드 서버 캐시 삭제 기능
api route에 프론트엔드 서버 캐시를 삭제할 수 있는 endpoint를 추가했습니다.
이 api를 호출하면 서버의 캐시를 무효화할 수 있습니다.
추후에 로그인 한 사람만 실행할 수 있도록 방어코드를 작성해도 좋을 것 같아요.
그 외 구현 사항은 단순합니다.
다만 실제로 캐시가 무효화되는지는 정확하게 검증해보진 못했어요. 추후에 캐시 안 맞는 문제가 있을 때 눌러보면서 확인해봐요!
구현 영상
2025-11-28.00-47-03.mp4