File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,4 +55,18 @@ enum Policy {
5555 /// 3. If no cache exists and online, fetch and return
5656 /// 4. If no cache and offline, throw [CacheMissException]
5757 staleWhileRefresh,
58+
59+ /// Returns cached data if available; always refreshes in background.
60+ ///
61+ /// Similar to [staleWhileRefresh] but triggers a background refresh even
62+ /// if the cache is still valid. This ensures that subscribers always
63+ /// receive the most up-to-date data while still benefiting from fast
64+ /// cache access.
65+ ///
66+ /// Behavior:
67+ /// 1. If cache exists, return it immediately
68+ /// 2. Always trigger background refresh if online
69+ /// 3. If no cache exists and online, fetch and return
70+ /// 4. If no cache and offline, throw [CacheMissException]
71+ cacheAndRefresh
5872}
You can’t perform that action at this time.
0 commit comments