chore: double HTTP cache, quadruple extractor cache

This commit is contained in:
WebStreamr 2025-08-16 16:40:15 +00:00
parent 5316199b8c
commit ef613f2742
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ export class ExtractorRegistry {
public constructor(logger: winston.Logger, extractors: Extractor[]) {
this.logger = logger;
this.extractors = extractors;
this.urlResultCache = new TTLCache({ max: 1024 });
this.urlResultCache = new TTLCache({ max: 4096 });
}
public async handle(ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise<UrlResult[]> {

View file

@ -64,7 +64,7 @@ export class Fetcher {
private readonly logger: winston.Logger;
private readonly httpCache = new LRUCache<string, Buffer>({ max: 1024 });
private readonly httpCache = new LRUCache<string, Buffer>({ max: 2048 });
private readonly rateLimitedCache = new TTLCache<string, undefined>({ max: 1024 });
private readonly semaphores = new Map<string, SemaphoreInterface>();
private readonly hostUserAgentMap = new Map<string, string>();