summaryrefslogtreecommitdiff
path: root/apps/web/lib/query-client.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-09 23:13:08 -0800
committerFuwn <[email protected]>2026-02-09 23:13:08 -0800
commit2cb58bde47a2475aa85184e34a1432a997312186 (patch)
treeed5a7e4ef4d96da03028294842a5e0e03360242d /apps/web/lib/query-client.ts
parentfix: add spacing between collapsible appearance settings sections (diff)
downloadasa.news-2cb58bde47a2475aa85184e34a1432a997312186.tar.xz
asa.news-2cb58bde47a2475aa85184e34a1432a997312186.zip
feat: offline support tier 1 — IndexedDB query persistence and offline banner
Persist React Query cache to IndexedDB via idb-keyval so timeline, entry details, subscriptions, and other read data survive page reloads and brief offline periods. Add network status banner in reader layout.
Diffstat (limited to 'apps/web/lib/query-client.ts')
-rw-r--r--apps/web/lib/query-client.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/web/lib/query-client.ts b/apps/web/lib/query-client.ts
index 82be2df..c64e4c7 100644
--- a/apps/web/lib/query-client.ts
+++ b/apps/web/lib/query-client.ts
@@ -1,10 +1,13 @@
import { QueryClient } from "@tanstack/react-query"
+const TWENTY_FOUR_HOURS_IN_MILLISECONDS = 1000 * 60 * 60 * 24
+
export function createQueryClient() {
return new QueryClient({
defaultOptions: {
queries: {
staleTime: 60_000,
+ gcTime: TWENTY_FOUR_HOURS_IN_MILLISECONDS,
refetchOnWindowFocus: false,
},
},