await cache update to avoid hammering redis in UrlPreviewService.ts

This commit is contained in:
Hazelnoot 2025-05-05 09:36:17 -04:00
parent a1fcf554fa
commit 23267a3a96

View file

@ -172,7 +172,8 @@ export class UrlPreviewService {
await this.inferActivityPubLink(summary); await this.inferActivityPubLink(summary);
} }
this.previewCache.set(cacheKey, summary); // Await this to avoid hammering redis when a bunch of URLs are fetched at once
await this.previewCache.set(cacheKey, summary);
// Cache 1 day (matching redis) // Cache 1 day (matching redis)
reply.header('Cache-Control', 'public, max-age=86400'); reply.header('Cache-Control', 'public, max-age=86400');