#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.SecureHttpFetch](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch')

## CachingSecureHttpFetcherDecorator Class

A decorator for [ISecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher') that adds caching capabilities\.
Caches successful responses for the configured duration to reduce network calls
and improve performance\.

```csharp
public class CachingSecureHttpFetcherDecorator : Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → CachingSecureHttpFetcherDecorator

Implements [ISecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher')
### Constructors

## CachingSecureHttpFetcherDecorator\(ISecureHttpFetcher, IMemoryCache, IOptionsMonitor\<OidcOptions\>\) Constructor {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,Microsoft.Extensions.Caching.Memory.IMemoryCache,Microsoft.Extensions.Options.IOptionsMonitor_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

A decorator for [ISecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher') that adds caching capabilities\.
Caches successful responses for the configured duration to reduce network calls
and improve performance\.

```csharp
public CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher inner, Microsoft.Extensions.Caching.Memory.IMemoryCache cache, Microsoft.Extensions.Options.IOptionsMonitor<Abblix.Oidc.Server.Common.Configuration.OidcOptions> oidcOptions);
```
#### Parameters

###### `inner` [ISecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher') {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,Microsoft.Extensions.Caching.Memory.IMemoryCache,Microsoft.Extensions.Options.IOptionsMonitor_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).inner}

The inner fetcher to decorate\.

###### `cache` [Microsoft\.Extensions\.Caching\.Memory\.IMemoryCache](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.memory.imemorycache 'Microsoft\.Extensions\.Caching\.Memory\.IMemoryCache') {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,Microsoft.Extensions.Caching.Memory.IMemoryCache,Microsoft.Extensions.Options.IOptionsMonitor_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).cache}

The memory cache to store responses\.

###### `oidcOptions` [Microsoft\.Extensions\.Options\.IOptionsMonitor&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptionsmonitor-1 'Microsoft\.Extensions\.Options\.IOptionsMonitor\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptionsmonitor-1 'Microsoft\.Extensions\.Options\.IOptionsMonitor\`1') {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,Microsoft.Extensions.Caching.Memory.IMemoryCache,Microsoft.Extensions.Options.IOptionsMonitor_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).oidcOptions}

OIDC options containing the cache duration configuration\.
### Methods

## CachingSecureHttpFetcherDecorator\.FetchAsync\<T\>\(Uri\) Method {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.FetchAsync_T_(System.Uri)}

Fetches content from a URI with SSRF protection\.
For JSON content, deserializes to the specified type\.
For raw content like JWT strings, use string as the type parameter\.

```csharp
public System.Threading.Tasks.Task<Abblix.Utils.Result<T,Abblix.Oidc.Server.Common.OidcError>> FetchAsync<T>(System.Uri uri);
```
#### Type parameters

###### `T` {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.FetchAsync_T_(System.Uri).T}

The type to deserialize the response to\. Use string for raw text content\.
#### Parameters

###### `uri` [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') {#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.FetchAsync_T_(System.Uri).uri}

The URI to fetch content from\.

Implements [FetchAsync&lt;T&gt;\(Uri\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher#Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher.FetchAsync_T_(System.Uri) 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher\.FetchAsync\<T\>\(System\.Uri\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[T](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator#Abblix.Oidc.Server.Features.SecureHttpFetch.CachingSecureHttpFetcherDecorator.FetchAsync_T_(System.Uri).T 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.CachingSecureHttpFetcherDecorator\.FetchAsync\<T\>\(System\.Uri\)\.T')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A Result containing either the deserialized content or an OidcError if the fetch operation fails\.
