Adding Support for DedicatedGatewayRequestOptions and MaxIntegratedCacheStaleness #20783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the integrated cache (with the dedicated gateway) has a default expiration time for each of the entries in the cache (CacheEntryExpirationTime) of 5 minutes. Any response served from cache is guaranteed to be no staler than this CacheEntryExpirationTime. In the existing design, CacheEntryExpirationTime cannot be configured by customers.
For customers to have more control over how stale each of their requests could be, we plan to introduce a new “RequestOption” called “MaxIntegratedCacheStaleness”. This option will allow the customer to set a lower bound on the lifespan of the response from the cache for each request. If the lifetime of the response stored in the cache is greater than the value indicated by “MaxIntegratedCacheStaleness”, that item will not be served from the cache and the request will go to the backend.
Similar PRs: [Cosmos] Add max_integrated_cache_staleness param option to item methods azure-sdk-for-python#22946 / Added Dedicated Gateway MaxIntegratedCacheStaleness to CosmosItemRequestOptions and CosmosQueryRequestOptions azure-sdk-for-java#20971
Related Docs: https://docs.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway / https://docs.microsoft.com/en-us/azure/cosmos-db/integrated-cache