YouTubeВозможностиЦеныБлог
Начать бесплатно
← К блогу

Как кэш снижает затраты на AI-модерацию на 60%

30.05.2026

The spam attack problem

A viral video might receive 10,000 identical crypto scam comments. Without caching, each one triggers a separate AI API call.

Two-layer cache

  1. Exact match — PostgreSQL KV lookup, 7-day TTL
  2. Similarity match — pgvector cosine distance < 0.05 returns majority classification

Fallback when AI is slow

If OpenAI latency exceeds 3 seconds, a rule-based classifier takes over automatically. See AI spam detection details.