Align and consolidate cache expiration settings across CacheService#1973
Draft
Align and consolidate cache expiration settings across CacheService#1973
Conversation
Create centralized CacheDurations class with standardized durations: - Tenant: 12 hours (unchanged) - Subscription: 2 hours (was 12 hours) - AuthenticatedClient: 15 minutes - ServiceData: 5 minutes (was 1 hour or 15 minutes) Update all services to reference centralized constants: - TenantService, SubscriptionService, ResourceGroupService - AksService, CosmosService, FunctionAppService - KustoService, SearchService, SignalRService Fixes #590 Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement feature from issue 590
Align and consolidate cache expiration settings across CacheService
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cache durations across services were inconsistent—some cached for 12 hours, others for 1 hour, with no centralized policy. This consolidates all cache TTLs into four standardized tiers.
Centralized
CacheDurationsconstantsNew static class in
core/Microsoft.Mcp.Core/src/Services/Caching/CacheDurations.cs:TenantSubscriptionAuthenticatedClientServiceDataDuration changes
AuthenticatedClient(15min) forCosmosClientinstances andServiceData(5min) for database/container listsCacheDurations.TenantTests
Added
CacheDurationsTestsvalidating all four tier values and their ordering.Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
learn.microsoft.com/home/REDACTED/work/mcp/mcp/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/bin/Debug/net10.0/Azure.Mcp.Core.UnitTests /home/REDACTED/work/mcp/mcp/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/bin/Debug/net10.0/Azure.Mcp.Core.UnitTests @@ /tmp/tmpgty3Y9.tmp grep -l ICacheService ice.cs /usr/bin/grep(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.