Explorar o código

feat: increase cache size and time

Sv443 hai 1 ano
pai
achega
0cfaecafed
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      changelog.md
  2. 2 2
      src/features/lyrics.ts

+ 1 - 1
changelog.md

@@ -1,6 +1,6 @@
 ## 1.2.0
 - **Features / Changes:**
-  - Added a persistent cache to save lyrics in. Within a 2 week period, 300 lyric URLs are cached throughout sessions to save time and reduce server load.
+  - Added a persistent cache to save lyrics in. Up to 1000 of the most listened to songs are cached throughout sessions for 30 days to save time and reduce server load.
 
 [See pull request for more info](https://github.com/Sv443/BetterYTM/pull/TODO)
 

+ 2 - 2
src/features/lyrics.ts

@@ -23,9 +23,9 @@ void thresholdParam; // TODO: re-add once geniURL 1.4 is released
 //#MARKER new cache
 
 /** How many cache entries can exist at a time - this is used to cap memory usage */
-const maxLyricsCacheSize = 300;
+const maxLyricsCacheSize = 1000;
 /** Maximum time before a cache entry is force deleted */
-const cacheTTL = 1000 * 60 * 60 * 24 * 7 * 2; // 2 weeks
+const cacheTTL = 1000 * 60 * 60 * 24 * 30; // 30 days
 
 export type LyricsCache = {
   cache: LyricsCacheEntry[];