optimize: xác nhận redis đã nén dữ liệu

This commit is contained in:
3dtours committed 2026-06-16 20:22:53 +07:00
1 parent 37b5d14d7e
commit 1709638bfd
3 files changed
+3 -1

No files matched your search

@@ -74,6 +74,7 @@ export class CompressCacheInterceptor implements NestInterceptor {
try {
const compressed = await gzip(Buffer.from(jsonString, 'utf8'));
await this.cacheManager.set(cacheKey, compressed, ttl);
console.log(`[Cache] 📦 Đã nén dữ liệu cho: ${cacheKey} (${jsonString.length} -> ${compressed.length} bytes)`);
// Không setHeader ở đây vì response có thể đã gửi xong
} catch (e) {
console.error(`[Cache] Lỗi nén dữ liệu cho key ${cacheKey}:`, e);