Skip to content

Commit 16d2510

Browse files
ealsurjcocchi
andauthored
Update articles/cosmos-db/nosql/best-practice-dotnet.md
Co-authored-by: Justine Cocchi <[email protected]>
1 parent 27ce4ed commit 16d2510

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/cosmos-db/nosql/best-practice-dotnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Watch the video below to learn more about using the .NET SDK from an Azure Cosmo
5353

5454
## Best practices for HTTP connections
5555

56-
The .NET SDK uses `HttpClient` to perform HTTP operations for both data plane for Gateway mode and [metadata for Direct mode](sdk-connection-modes.md#direct-mode). One of the [fundamentals of HttpClient](/dotnet/fundamentals/networking/http/httpclient-guidelines#dns-behavior) is to make sure the `HttpClient` can react to DNS changes on your account by **customizing the pooled connection lifetime**. As long as pooled connections are kept open, they do not react to DNS changes. This setting forces pooled **connections to be closed** periodically, ensuring that your application reacts to DNS changes. Our recommendation is that you customize this value according to your [connectivity mode](sdk-connection-modes.md) and workload to balance the performance impact of frequently creating new connections, with needing to react to DNS changes (a 5 minute value would be a good start for Direct mode clients).
56+
The .NET SDK uses `HttpClient` to perform HTTP requests regardless of the connectivity mode configured. In [Direct mode](sdk-connection-modes.md#direct-mode) HTTP is used for metadata operations and in Gateway mode it is used for both data plane and metadata operations. One of the [fundamentals of HttpClient](/dotnet/fundamentals/networking/http/httpclient-guidelines#dns-behavior) is to make sure the `HttpClient` can react to DNS changes on your account by **customizing the pooled connection lifetime**. As long as pooled connections are kept open, they do not react to DNS changes. This setting forces pooled **connections to be closed** periodically, ensuring that your application reacts to DNS changes. Our recommendation is that you customize this value according to your [connectivity mode](sdk-connection-modes.md) and workload to balance the performance impact of frequently creating new connections, with needing to react to DNS changes (a 5 minute value would be a good start for Direct mode clients).
5757

5858
You can inject your custom HttpClient through `CosmosClientOptions.HttpClientFactory`, for example:
5959

0 commit comments

Comments
 (0)