attempt to optimize the tagList query

- this query in some cases can return a very large amount of data, depending on the size of the user's library
- increasing the cacheTime reduces the frequency of fetches while disabling structuralSharing reduces the need for react-query to do a deep equality comparison for the cache
This commit is contained in:
jeffvli
2026-02-13 11:53:42 -08:00
parent 1338513f82
commit 123842dfda
@@ -30,7 +30,7 @@ export const sharedQueries = {
},
tagList: (args: QueryHookArgs<TagListQuery>) => {
return queryOptions({
gcTime: 1000 * 60,
gcTime: 1000 * 60 * 24,
queryFn: ({ signal }) => {
return api.controller.getTagList({
apiClientProps: { serverId: args.serverId, signal },
@@ -38,7 +38,8 @@ export const sharedQueries = {
});
},
queryKey: queryKeys.tags.list(args.serverId || '', args.query.type),
staleTime: 1000 * 60,
staleTime: 1000 * 60 * 24,
structuralSharing: false,
...args.options,
});
},