Repository navigation
feat(cache): conditional refresh with GetOrRevalidateAsync - #574
cosmin-staicu wants to merge 1 commit into
Conversation
9a816c9 to
d7ee8d5
Compare
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
Other signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
d7ee8d5 to
c4540e2
Compare
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
Other signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
c4540e2 to
2079b8a
Compare
2079b8a to
f19ec47
Compare
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
Other signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
f19ec47 to
5d51fb4
Compare
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
Other signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
9f0f1af to
1f3bb0a
Compare
Add GetOrRevalidateAsync with a RevalidationContext<T> that carries the previous value, its ETag and Last-Modified, and RevalidatedValue<T> with Modified and NotModified. Validators ride in entry metadata and never in events. A miss revalidates through the fail-safe pipeline with the soft timeout, and rehydrate revalidates in the background. A NotModified is bound to the context that made it. Analyzers cover the new members; docs and changelog describe the recipes and limits. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
1f3bb0a to
cb7a4ee
Compare
|



Problem
A cache generator can fetch a replacement value, but it needs the previous value and its validators to ask the source whether that value is still current.
Change
GetOrRevalidateAsyncgives typed and untyped cache callers a generator context with the previous value, its ETag and last-modified timestamp when available. A generator can returnModifiedto replace the value orNotModifiedfrom the supplied context to renew the kept value. Revalidation works with background rehydration and on expiry with fail-safe. The generator analyzers cover the new overloads, and allocation tests pin the hit and miss paths.The API takes a single
CacheKey. Batch and hash calls,Span<char>andCacheKeyHandlerkeys, and aGetOrAddResultcounterpart are outside this release. The stored-value and broadcast wire formats stay unchanged.The overload guide covers both policies and when to send a conditional request. The resilience guide links to the recipes, the interfaces reference and glossary document the API and validators, and the changelog records the feature.
Behaviour change
Conditional refresh is opt-in through
GetOrRevalidateAsync. ExistingGetOrAddAsynccalls keep their overload bindings.Release net10.0 recorded 9,246 passed and 275 skipped in Caching, 226 passed and 0 skipped in Analyzers, 2,166 passed and 59 skipped in Migration, and 67 passed and 0 skipped in PluginContract.
Release net8.0 recorded 9,200 passed and 278 skipped in Caching, 226 passed and 0 skipped in Analyzers, 2,166 passed and 59 skipped in Migration, and 67 passed and 0 skipped in PluginContract.