From 31c784f0ab725f6d1e8c20065e5c092dec551cdb Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Mon, 29 Dec 2025 15:41:12 +0100 Subject: [PATCH] Renamed SearchCache mentions to QueryCache for better clarity --- src/Server/Controllers/SearchdomainController.cs | 6 +++--- src/Server/Views/Home/Index.cshtml | 8 ++++---- src/Shared/Models/SearchdomainResults.cs | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Server/Controllers/SearchdomainController.cs b/src/Server/Controllers/SearchdomainController.cs index a5e3992..30e0124 100644 --- a/src/Server/Controllers/SearchdomainController.cs +++ b/src/Server/Controllers/SearchdomainController.cs @@ -244,7 +244,7 @@ public class SearchdomainController : ControllerBase /// Get the query cache size of a searchdomain /// /// Name of the searchdomain - [HttpGet("SearchCache/Size")] + [HttpGet("QueryCache/Size")] public ActionResult GetSearchCacheSize([Required]string searchdomain) { (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.Value.EstimateSize(); } - return Ok(new SearchdomainSearchCacheSizeResults() { SearchCacheSizeBytes = sizeInBytes, Success = true }); + return Ok(new SearchdomainSearchCacheSizeResults() { QueryCacheSizeBytes = sizeInBytes, Success = true }); } /// /// Clear the query cache of a searchdomain /// /// Name of the searchdomain - [HttpPost("SearchCache/Clear")] + [HttpPost("QueryCache/Clear")] public ActionResult InvalidateSearchCache([Required]string searchdomain) { (Searchdomain? searchdomain_, int? httpStatusCode, string? message) = SearchdomainHelper.TryGetSearchdomain(_domainManager, searchdomain, _logger); diff --git a/src/Server/Views/Home/Index.cshtml b/src/Server/Views/Home/Index.cshtml index 00e41c2..22f6319 100644 --- a/src/Server/Views/Home/Index.cshtml +++ b/src/Server/Views/Home/Index.cshtml @@ -804,7 +804,7 @@ .getElementById('cacheClear') .addEventListener('click', () => { const domainKey = getSelectedDomainKey(); - fetch(`/Searchdomain/SearchCache/Clear?searchdomain=${encodeURIComponent(domains[domainKey])}`, { + fetch(`/Searchdomain/QueryCache/Clear?searchdomain=${encodeURIComponent(domains[domainKey])}`, { method: 'POST' }).then(response => { if (response.ok) { @@ -1031,7 +1031,7 @@ } 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()); } @@ -1106,10 +1106,10 @@ } }); cacheUtilizationPromise.then(cacheUtilization => { - if (cacheUtilization != null && cacheUtilization.SearchCacheSizeBytes != null) + if (cacheUtilization != null && cacheUtilization.QueryCacheSizeBytes != null) { document.querySelector('#cacheUtilization').innerText = - `${NumberOfBytesAsHumanReadable(cacheUtilization.SearchCacheSizeBytes)}`; + `${NumberOfBytesAsHumanReadable(cacheUtilization.QueryCacheSizeBytes)}`; } else { showToast("@T["Unable to fetch searchdomain cache utilization"]", "danger"); console.error('Failed to fetch searchdomain cache utilization'); diff --git a/src/Shared/Models/SearchdomainResults.cs b/src/Shared/Models/SearchdomainResults.cs index e45c901..799d5c4 100644 --- a/src/Shared/Models/SearchdomainResults.cs +++ b/src/Shared/Models/SearchdomainResults.cs @@ -43,8 +43,8 @@ public class SearchdomainSettingsResults : SuccesMessageBaseModel public class SearchdomainSearchCacheSizeResults : SuccesMessageBaseModel { - [JsonPropertyName("SearchCacheSizeBytes")] - public required long? SearchCacheSizeBytes { get; set; } + [JsonPropertyName("QueryCacheSizeBytes")] + public required long? QueryCacheSizeBytes { get; set; } } public class SearchdomainInvalidateCacheResults : SuccesMessageBaseModel {}