Chore: limit HTTP persistent cache entry count

This commit is contained in:
SukkaW
2026-03-03 22:22:50 +08:00
parent 34eb1cbf7f
commit e6b5635daf

View File

@@ -121,6 +121,7 @@ const agent = new Agent({ allowH2: false });
store: new BetterSqlite3CacheStore({ store: new BetterSqlite3CacheStore({
loose: true, loose: true,
location: path.join(CACHE_DIR, 'undici-better-sqlite3-cache-store.db'), location: path.join(CACHE_DIR, 'undici-better-sqlite3-cache-store.db'),
maxCount: 128,
maxEntrySize: 1024 * 1024 * 100 // 100 MiB maxEntrySize: 1024 * 1024 * 100 // 100 MiB
}), }),
cacheByDefault: 600 // 10 minutes cacheByDefault: 600 // 10 minutes