Skip to content

Commit

Permalink
Update FailSafe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jodydonetti authored Jan 20, 2024
1 parent 09fbb4a commit d77f6f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/FailSafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ That's ok in most situations, and is the tradeoff we accept to obtain better per

Setting an **expiration** to a cache entry is also good thing: it prevents us from using a piece of data for too long, giving us the ability to refresh the value from its source - say, a database - after some time.

Sometimes though when the entry **expires** and we go get an updated value from the database, things **may go bad**: the database may be totally down or overloaded, there may be temporary network congestion or really anything else bad that can happen.
Sometimes though when the entry **expires** and we go get an updated value from the database, things **may go bad**: the database may be totally down or overloaded, there may be temporary network congestion or really anything else bad that can happen, and this will result in the factory throwing an exception.

In these cases what happens is your service will be down or super slow, like this:

Expand All @@ -24,7 +24,7 @@ Wouldn't it be nice to have a way to keep using a stale value for a little longe

This is exactly what the **Fail-Safe** mechanism does.

It allows us to specify for how long each entry should be kept around in case of problems, while at the same time let them *logically* expire at the right time, all while letting us re-use them in case of an unexpected problem that would normally result in an exception.
It allows us to specify for how long each entry should be kept around after it expired in case of problems (that is, when the factory throws an exception) while at the same time let them *logically* expire at the right time, all while letting us re-use them in case of an unexpected problem that would normally result in the factory exception bubbling up to our calling code.

To do that we have to simply set 3 things on a `FusionCacheEntryOptions` object:

Expand Down

0 comments on commit d77f6f4

Please sign in to comment.