From 205cf2687ce48f3d004792ff223422a86cc6bdbc Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 6 May 2026 20:41:49 -0500 Subject: feat(cache): persist read-only API responses Add a bounded stale-while-revalidate cache at the Sourcehut API boundary with stable keys, centralized TTLs, request coalescing, payload hashing, and LRU disk pruning. Cache high-value read-only repo, build, ticket, project, profile, paste, and Home/Work Queue data while keeping mutations network-only and invalidating related prefixes after successful writes. Add focused cache tests and implementation notes. --- Hutch/Views/Pastes/PasteListViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Hutch/Views/Pastes/PasteListViewModel.swift') diff --git a/Hutch/Views/Pastes/PasteListViewModel.swift b/Hutch/Views/Pastes/PasteListViewModel.swift index 640e31b..059dfa0 100644 --- a/Hutch/Views/Pastes/PasteListViewModel.swift +++ b/Hutch/Views/Pastes/PasteListViewModel.swift @@ -43,7 +43,7 @@ final class PasteListViewModel { } func loadPastes() async { - if pastes.isEmpty, let cached = service.loadCachedPastes() { + if pastes.isEmpty, let cached = await service.loadCachedPastes() { pastes = cached.results cursor = cached.cursor hasMore = cached.cursor != nil -- cgit v1.2.3