perf(backend): cache YouTube searches and shrink the thumbnail URLs

Repeated searches and song lookups now reuse a single-flight memory cache, so
concurrent or debounced queries hit YouTube once instead of on every keystroke.
Thumbnails are resolved at a configurable size instead of the largest variant,
which cuts the image payload the browser pulls from Google.
This commit is contained in:
2026-07-20 17:29:28 +02:00
parent 7c62f8a8e8
commit dd3150e3d4
5 changed files with 144 additions and 9 deletions
@@ -14,5 +14,14 @@ namespace Musify.Infrastructure.Configuration
[Range(60, 3600)]
public int SearchContinuationCacheSeconds { get; set; } = 600;
[Range(0, 86400)]
public int SearchResultsCacheSeconds { get; set; } = 900;
[Range(0, 604800)]
public int SongInfoCacheSeconds { get; set; } = 86400;
[Range(32, 720)]
public int ThumbnailSize { get; set; } = 240;
}
}