Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Integrated cache: Add BypassIntegratedCache to DedicatedGatewayReques…
…tOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.
  • Loading branch information
jackiepmsft committed May 3, 2023
commit da0d0af6173f9538218002b17a2f59b25f7d1949
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public class DedicatedGatewayRequestOptions
/// </remarks>
public TimeSpan? MaxIntegratedCacheStaleness { get; set; }

/// <summary>
/// Gets or sets if bypass the integrated cache or not associated with the request in the Azure CosmosDB service.
/// </summary>
/// <value>Default value is false.</value>
public bool? BypassIntegratedCache { get; set; }

internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions, RequestMessage request)
{
if (dedicatedGatewayRequestOptions?.MaxIntegratedCacheStaleness != null)
Expand All @@ -36,6 +42,11 @@ internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayR

request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness, cacheStalenessInMilliseconds.ToString(CultureInfo.InvariantCulture));
}

if (dedicatedGatewayRequestOptions?.BypassIntegratedCache != null)
{
request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache, true.ToString(CultureInfo.InvariantCulture));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3917,6 +3917,18 @@
"Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": {
"Subclasses": {},
"Members": {
"System.Nullable`1[System.Boolean] BypassIntegratedCache": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.Boolean] BypassIntegratedCache;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.Boolean] get_BypassIntegratedCache()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.TimeSpan] get_MaxIntegratedCacheStaleness()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand All @@ -3934,6 +3946,13 @@
"Attributes": [],
"MethodInfo": "[Void .ctor(), Void .ctor()]"
},
"Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void set_MaxIntegratedCacheStaleness(System.Nullable`1[System.TimeSpan])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
Expand Down