From b95f9521660760b0e06930f5f0d4bb60e5e29675 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Fri, 8 Aug 2025 09:24:14 -0600 Subject: [PATCH] Add a few quick wins for caching --- apps/web/src/context/AppProviders.tsx | 1 - apps/web/src/context/BusterReactQuery/createPersister.ts | 2 +- apps/web/src/context/BusterReactQuery/queryClientConfig.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/web/src/context/AppProviders.tsx b/apps/web/src/context/AppProviders.tsx index 91434336d..bb10cab3c 100644 --- a/apps/web/src/context/AppProviders.tsx +++ b/apps/web/src/context/AppProviders.tsx @@ -5,7 +5,6 @@ import type { UseSupabaseUserContextType } from '@/lib/supabase'; import { BusterAssetsProvider } from './Assets/BusterAssetsProvider'; import { AppLayoutProvider } from './BusterAppLayout'; import { BusterReactQueryProvider } from './BusterReactQuery/BusterReactQueryAndApi'; -import { BusterWebSocketProvider } from './BusterWebSocket'; import { BusterNewChatProvider } from './Chats'; import { BusterPosthogProvider } from './Posthog'; import { RoutePrefetcher } from './RoutePrefetcher'; diff --git a/apps/web/src/context/BusterReactQuery/createPersister.ts b/apps/web/src/context/BusterReactQuery/createPersister.ts index 81c7b051c..7fd2c1904 100644 --- a/apps/web/src/context/BusterReactQuery/createPersister.ts +++ b/apps/web/src/context/BusterReactQuery/createPersister.ts @@ -6,7 +6,7 @@ import packageJson from '../../../package.json'; const buster = packageJson.version; -export const PERSIST_TIME = 1000 * 60 * 60 * 24 * 7; // 7 days +export const PERSIST_TIME = 1000 * 60 * 60 * 24 * 3; // 3 days export const PERSISTED_QUERIES = [queryKeys.slackGetChannels.queryKey].map(hashKey); diff --git a/apps/web/src/context/BusterReactQuery/queryClientConfig.ts b/apps/web/src/context/BusterReactQuery/queryClientConfig.ts index e6414ac07..1c316c7fa 100644 --- a/apps/web/src/context/BusterReactQuery/queryClientConfig.ts +++ b/apps/web/src/context/BusterReactQuery/queryClientConfig.ts @@ -1,4 +1,4 @@ export const PREFETCH_STALE_TIME = 1000 * 10; // 10 seconds export const ERROR_RETRY_DELAY = 1 * 1000; // 1 second delay after error -export const GC_TIME = 1000 * 60 * 60 * 24 * 3; // 24 hours - matches persistence duration +export const GC_TIME = 1000 * 60 * 60 * 24 * 3; // 3 days - matches persistence duration export const USER_CANCELLED_ERROR = new Error('User cancelled');