Improve proxy cache behavior and diagnostics

This commit is contained in:
ajp_anton
2026-07-20 02:17:08 +00:00
parent a97e2bb37f
commit 4bd6277635
10 changed files with 503 additions and 64 deletions
@@ -68,6 +68,30 @@ public sealed class ItemsProxyRequestBuilderTests
Assert.Contains("|SortName|Descending|L|20|10|fi-FI|", result.CacheKey);
}
[Fact]
public void BuildUsesOneUpstreamKeyForDifferentLocalPagingControls()
{
var request = HttpRequest();
var first = ItemsProxyRequestBuilder.Build(
request,
"/Items?SortBy=SortName&StartIndex=0&Limit=100",
"token",
UserId,
multilangEnabled: true);
var second = ItemsProxyRequestBuilder.Build(
request,
"/Items?SortBy=SortName&StartIndex=100&Limit=100",
"token",
UserId,
multilangEnabled: true);
Assert.NotNull(first);
Assert.NotNull(second);
Assert.Equal(first.NormalizedUrlForCache, second.NormalizedUrlForCache);
Assert.NotEqual(first.CacheKey, second.CacheKey);
}
[Fact]
public void BuildLeavesSortAndPagingUpstreamWhenMultilangDisabled()
{