Skip to content

Commit 935938b

Browse files
committed
feat(#128): STORIES_LIST 캐싱 시간 상수화 및 staleTime/gcTime 적용
1 parent 6361a5f commit 935938b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/story/_api/stories.queries.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ export const storiesQueryKeys = {
1212
[...storiesQueryKeys.kakaoLists(), kakaoId, { size }] as const,
1313
} as const;
1414

15+
export const CACHE_CONSTANTS = {
16+
STORIES_LIST: {
17+
STALE_TIME: 5 * 60 * 1000,
18+
GC_TIME: 10 * 60 * 1000,
19+
},
20+
} as const;
21+
1522
export const storiesQueryOptions = (size: number) =>
1623
queryOptions({
1724
queryKey: storiesQueryKeys.lists(),
1825
queryFn: () => getStories(size),
26+
staleTime: CACHE_CONSTANTS.STORIES_LIST.STALE_TIME,
27+
gcTime: CACHE_CONSTANTS.STORIES_LIST.GC_TIME,
1928
});
2029

2130
export const storiesByKakaoIdQueryOptions = (

0 commit comments

Comments
 (0)