Skip to content

Commit

Permalink
Updates for mediator
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Sep 12, 2024
1 parent ac6a908 commit 8d95eaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/content/docs/client/mediator/middleware/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,18 @@ public class CacheAttribute : Attribute
public int AbsoluteExpirationSeconds { get; set; }
public int SlidingExpirationSeconds { get; set; }
}
```

### Deeper Cache Control

You can add the ICacheControl to your contract to control cache directly at the point of call.

ForceRefresh allows an easy way to bypass cache and SetEntry allows you to set cache entry properties.

```csharp
public class MyContract : IRequest<SomeResponse>, ICacheControl
{
public bool ForceRefresh { get; set; }
public Action<ICacheEntry>? SetEntry { get; set; } // optional: allows you to set cache entry properties
}
```
1 change: 1 addition & 0 deletions src/content/docs/release-notes/mediator/v10.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import RN from '../../../../components/ReleaseNote.astro';
# 1.8.0 - September 11, 2024
<RN type="feature">New HTTP Request Handler and framework</RN>
<RN type="feature">New HTTP Request OpenAPI source generator</RN>
<RN type="enhancement">ICacheControl is now available for contracts that allows more direct control over your cached calls</RN>
<RN type="fix">OfflineAvailableAttribute was not allowed to be applied to contracts</RN>

# 1.7.4 - August 9, 2024
Expand Down

0 comments on commit 8d95eaf

Please sign in to comment.