Skip to main content
February 19, 20261.0.16v1.0.16RSS

v1.0.16 — [Performance] QueryClient has no staleTime — every mount triggers a refetch

Release Notes

src/lib/trpc/provider.tsx initialises new QueryClient() with zero configuration. Without defaultOptions.queries.staleTime, React Query considers every cached result immediately stale, firing a network request on every component mount. The dashboard has 15+ tRPC queries per page, creating a waterfall of refetches on every navigation.

Category: caching File: src/lib/trpc/provider.tsx Recommendation: Set defaultOptions: { queries: { staleTime: 30_000, gcTime: 300_000 } } in the QueryClient constructor. Long-lived queries (revenue analytics, cohort retention at 5min interval) already call refetchInterval explicitly and don't need staleTime changes. Short-lived queries like beast-mode status (2s interval) already control their own freshness. Estimated Improvement: Reduces redundant API calls by ~60-70% during normal navigation; measurable improvement in UI responsiveness