Skip to content

Commit

Permalink
Update README.md with usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsided committed Aug 13, 2023
1 parent f1e1ccb commit f5c8162
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,18 @@

Provides the `HttpContext.GetRequestCacheControl()` extension method for accessing
the HTTP/1.1 `Cache-Control` and HTTP/1.0 `Pragma` header directives.

## Usage example

Register the Cache-Control middleware on your `IApplicationBuilder`:

```csharp
app.UseCacheControlMiddleware();
```

From within your action, use the `GetRequestCacheControl` extension
method on the HTTP context to get the Cache-Control header information:

```csharp
ICacheControl cacheControl = HttpContext.GetRequestCacheControl();
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public interface ICacheControl
/// <c>Pragma</c> request header was present.
/// </summary>
/// <remarks>
/// If this property evaluates to <see langword="false"/>, all properties of this
/// instance will have their default value.
/// If this property evaluates to <see langword="false"/>, all properties of this
/// instance will have their default value.
/// </remarks>
bool HeaderUsed { get; }

Expand Down

0 comments on commit f5c8162

Please sign in to comment.