From 703d211b2863eb55cdc67e2ac2982331fd6b647b Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:34:19 -0700 Subject: [PATCH 1/2] fix: make search revalidate & change cache to be 10 minutes --- apps/app-frontend/src/pages/Browse.vue | 2 +- packages/app-lib/src/state/cache.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/app-frontend/src/pages/Browse.vue b/apps/app-frontend/src/pages/Browse.vue index 253d8430eb..815aa137c1 100644 --- a/apps/app-frontend/src/pages/Browse.vue +++ b/apps/app-frontend/src/pages/Browse.vue @@ -884,7 +884,7 @@ async function search(requestParams: string) { const rawResults = await queryClient.fetchQuery({ queryKey: ['search', 'v3', requestParams], queryFn: () => - get_search_results_v3(requestParams) as Promise<{ + get_search_results_v3(requestParams, 'must_revalidate') as Promise<{ result: Labrinth.Search.v3.SearchResults & { hits: (Labrinth.Search.v3.ResultSearchProject & { installed?: boolean })[] } diff --git a/packages/app-lib/src/state/cache.rs b/packages/app-lib/src/state/cache.rs index e04104cbae..2848502443 100644 --- a/packages/app-lib/src/state/cache.rs +++ b/packages/app-lib/src/state/cache.rs @@ -101,6 +101,7 @@ impl CacheValueType { // ModpackFiles never expire - version_id is immutable so hashes never change // TODO: There has to be a way to exclude this from the "Purge cache" stuff? CacheValueType::ModpackFiles => 100 * 365 * 24 * 60 * 60, // 100 years (effectively never) + CacheValueType::SearchResults | CacheValueType::SearchResultsV3 => 10 * 60, // 10 minutes _ => 30 * 60, // 30 minutes } } From c019c54b4f0d236a765dc83ad3b1d37fef0d5774 Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:00:50 -0700 Subject: [PATCH 2/2] prepr --- packages/app-lib/src/state/cache.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app-lib/src/state/cache.rs b/packages/app-lib/src/state/cache.rs index 2848502443..8eb24acd86 100644 --- a/packages/app-lib/src/state/cache.rs +++ b/packages/app-lib/src/state/cache.rs @@ -101,7 +101,9 @@ impl CacheValueType { // ModpackFiles never expire - version_id is immutable so hashes never change // TODO: There has to be a way to exclude this from the "Purge cache" stuff? CacheValueType::ModpackFiles => 100 * 365 * 24 * 60 * 60, // 100 years (effectively never) - CacheValueType::SearchResults | CacheValueType::SearchResultsV3 => 10 * 60, // 10 minutes + CacheValueType::SearchResults | CacheValueType::SearchResultsV3 => { + 10 * 60 // 10 minutes + } _ => 30 * 60, // 30 minutes } }