Compare commits

...
Author SHA1 Message Date
Prospector c019c54b4f prepr 2026-07-09 15:00:50 -07:00
Prospector 703d211b28 fix: make search revalidate & change cache to be 10 minutes 2026-07-09 14:34:19 -07:00
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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 })[]
}
+3
View File
@@ -101,6 +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
}
_ => 30 * 60, // 30 minutes
}
}