Renamed SearchCache mentions to QueryCache for better clarity

This commit is contained in:
2025-12-29 15:41:12 +01:00
parent 625019f9f4
commit 31c784f0ab
3 changed files with 9 additions and 9 deletions

View File

@@ -244,7 +244,7 @@ public class SearchdomainController : ControllerBase
/// Get the query cache size of a searchdomain /// Get the query cache size of a searchdomain
/// </summary> /// </summary>
/// <param name="searchdomain">Name of the searchdomain</param> /// <param name="searchdomain">Name of the searchdomain</param>
[HttpGet("SearchCache/Size")] [HttpGet("QueryCache/Size")]
public ActionResult<SearchdomainSearchCacheSizeResults> GetSearchCacheSize([Required]string searchdomain) public ActionResult<SearchdomainSearchCacheSizeResults> GetSearchCacheSize([Required]string searchdomain)
{ {
(Searchdomain? searchdomain_, int? httpStatusCode, string? message) = SearchdomainHelper.TryGetSearchdomain(_domainManager, searchdomain, _logger); (Searchdomain? searchdomain_, int? httpStatusCode, string? message) = SearchdomainHelper.TryGetSearchdomain(_domainManager, searchdomain, _logger);
@@ -257,14 +257,14 @@ public class SearchdomainController : ControllerBase
sizeInBytes += entry.Key.Length * sizeof(char); // string characters sizeInBytes += entry.Key.Length * sizeof(char); // string characters
sizeInBytes += entry.Value.EstimateSize(); sizeInBytes += entry.Value.EstimateSize();
} }
return Ok(new SearchdomainSearchCacheSizeResults() { SearchCacheSizeBytes = sizeInBytes, Success = true }); return Ok(new SearchdomainSearchCacheSizeResults() { QueryCacheSizeBytes = sizeInBytes, Success = true });
} }
/// <summary> /// <summary>
/// Clear the query cache of a searchdomain /// Clear the query cache of a searchdomain
/// </summary> /// </summary>
/// <param name="searchdomain">Name of the searchdomain</param> /// <param name="searchdomain">Name of the searchdomain</param>
[HttpPost("SearchCache/Clear")] [HttpPost("QueryCache/Clear")]
public ActionResult<SearchdomainInvalidateCacheResults> InvalidateSearchCache([Required]string searchdomain) public ActionResult<SearchdomainInvalidateCacheResults> InvalidateSearchCache([Required]string searchdomain)
{ {
(Searchdomain? searchdomain_, int? httpStatusCode, string? message) = SearchdomainHelper.TryGetSearchdomain(_domainManager, searchdomain, _logger); (Searchdomain? searchdomain_, int? httpStatusCode, string? message) = SearchdomainHelper.TryGetSearchdomain(_domainManager, searchdomain, _logger);

View File

@@ -804,7 +804,7 @@
.getElementById('cacheClear') .getElementById('cacheClear')
.addEventListener('click', () => { .addEventListener('click', () => {
const domainKey = getSelectedDomainKey(); const domainKey = getSelectedDomainKey();
fetch(`/Searchdomain/SearchCache/Clear?searchdomain=${encodeURIComponent(domains[domainKey])}`, { fetch(`/Searchdomain/QueryCache/Clear?searchdomain=${encodeURIComponent(domains[domainKey])}`, {
method: 'POST' method: 'POST'
}).then(response => { }).then(response => {
if (response.ok) { if (response.ok) {
@@ -1031,7 +1031,7 @@
} }
function getSearchdomainCacheUtilization(domainKey) { function getSearchdomainCacheUtilization(domainKey) {
return fetch(`/Searchdomain/SearchCache/Size?searchdomain=${encodeURIComponent(domains[domainKey])}`) return fetch(`/Searchdomain/QueryCache/Size?searchdomain=${encodeURIComponent(domains[domainKey])}`)
.then(r => r.json()); .then(r => r.json());
} }
@@ -1106,10 +1106,10 @@
} }
}); });
cacheUtilizationPromise.then(cacheUtilization => { cacheUtilizationPromise.then(cacheUtilization => {
if (cacheUtilization != null && cacheUtilization.SearchCacheSizeBytes != null) if (cacheUtilization != null && cacheUtilization.QueryCacheSizeBytes != null)
{ {
document.querySelector('#cacheUtilization').innerText = document.querySelector('#cacheUtilization').innerText =
`${NumberOfBytesAsHumanReadable(cacheUtilization.SearchCacheSizeBytes)}`; `${NumberOfBytesAsHumanReadable(cacheUtilization.QueryCacheSizeBytes)}`;
} else { } else {
showToast("@T["Unable to fetch searchdomain cache utilization"]", "danger"); showToast("@T["Unable to fetch searchdomain cache utilization"]", "danger");
console.error('Failed to fetch searchdomain cache utilization'); console.error('Failed to fetch searchdomain cache utilization');

View File

@@ -43,8 +43,8 @@ public class SearchdomainSettingsResults : SuccesMessageBaseModel
public class SearchdomainSearchCacheSizeResults : SuccesMessageBaseModel public class SearchdomainSearchCacheSizeResults : SuccesMessageBaseModel
{ {
[JsonPropertyName("SearchCacheSizeBytes")] [JsonPropertyName("QueryCacheSizeBytes")]
public required long? SearchCacheSizeBytes { get; set; } public required long? QueryCacheSizeBytes { get; set; }
} }
public class SearchdomainInvalidateCacheResults : SuccesMessageBaseModel {} public class SearchdomainInvalidateCacheResults : SuccesMessageBaseModel {}