Skip to content

Cached object refresh #330

Answered by jodydonetti
jacob7395 asked this question in Q&A
Nov 13, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @jacob7395 , that was fast 😅

Ideally I would leave the timeout at 10 mins (possibly even reduce it) but when the object expires check the state, if it's still in progress re cache/extend the duration of the object in the cache.

if I got this right you may use Conditional Refresh but without the ETag part: basically you can look at ctx.StaleValue, do your own check on the progress, and if you need to cache the same thing for a little bit more you can just return ctx.NotModified().

You can also adapt the Duration or other options based on your own logic thanks to Adaptive Caching, if you like.

Of course all the other features of FusionCache like fail-safe, soft timeouts, eager refresh …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jacob7395
Comment options

Answer selected by jacob7395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants