diff options
| author | Christian Cleberg <[email protected]> | 2026-05-06 20:30:34 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-05-06 20:30:34 -0500 |
| commit | 57e4f34b4613c09beb0cb757ac2ba2b43cc04daf (patch) | |
| tree | 4c83a914f36919a5d1164fa39e7e0d5915c8730a /Hutch/Views/Tickets/TrackerListViewModel.swift | |
| parent | fba49d0955a6030406956b2bb1c2a60d184cfda6 (diff) | |
| download | hutch-57e4f34b4613c09beb0cb757ac2ba2b43cc04daf.tar.gz hutch-57e4f34b4613c09beb0cb757ac2ba2b43cc04daf.tar.bz2 hutch-57e4f34b4613c09beb0cb757ac2ba2b43cc04daf.zip | |
feat: add persistent stale-while-revalidate API cache
Introduce an actor-backed persistent cache layer at the SRHTClient boundary
for read-only SourceHut data. Cache entries now store stable metadata
including key, resource type, fetched/expires/access timestamps, payload
hash, schema version, and payload size, with bounded memory and disk usage.
Add centralized cache key builders and TTL defaults for repository, file,
ticket, build, log, profile, status, and list-style resources. Support
networkOnly, cacheOnly, cacheFirstThenRefresh, and refreshIgnoringCache
policies, plus request coalescing for duplicate in-flight cache keys.
Integrate first-pass caching into high-value low-risk read paths:
- build detail and completed/active build logs
- ticket detail
- README lookup
- repository tree, blob, and linked file reads
Keep mutation paths network-only and add simple prefix invalidation after
ticket and build mutations. Add compact cached/stale UI status rows and a
Settings action to clear the persistent cache.
Add focused cache tests covering round trips, expiration, stale fallback,
policy behavior, request coalescing, prefix invalidation, size limits, LRU
pruning, expired pruning, and mutation bypass behavior. Document storage,
key, TTL, invalidation, limitations, and next recommended targets.
Diffstat (limited to 'Hutch/Views/Tickets/TrackerListViewModel.swift')
0 files changed, 0 insertions, 0 deletions
