File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/ModelContextProtocol.Core/Server Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,18 @@ public ValueTask<ISseEventStreamWriter> CreateStreamAsync(SseEventStreamOptions
8787 /// <summary>
8888 /// Provides methods for generating cache keys.
8989 /// </summary>
90+ /// <remarks>
91+ /// Cache keys are versioned to allow format changes without conflicts with existing entries.
92+ /// When the cache format changes, increment <see cref="Version"/> to invalidate old entries.
93+ /// </remarks>
9094 internal static class CacheKeys
9195 {
92- private const string Prefix = "mcp:sse:" ;
96+ /// <summary>
97+ /// The current cache key version. Increment this when changing the cache format
98+ /// to ensure old entries are ignored.
99+ /// </summary>
100+ private const string Version = "v1" ;
101+ private const string Prefix = $ "mcp:sse:{ Version } :";
93102
94103 public static string StreamMetadata ( string sessionId , string streamId ) =>
95104 $ "{ Prefix } meta:{ sessionId } :{ streamId } ";
You can’t perform that action at this time.
0 commit comments