[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-ttl::en":3,"gloss-cluster-ttl::en":20,"gloss-next-ttl::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"ttl","data-infra","TTL (Time to Live)","TTL (Time to Live) is a value attached to a piece of stored data — most commonly a cache entry, but also DNS records, session tokens, and object storage lifecycle rules — specifying how long that data remains valid before it automatically expires and is either deleted or treated as stale and due for refresh. Why it matters for AI\u002FSaaS builders: TTL is the primary lever for balancing freshness against performance\u002Fcost in nearly every caching decision an AI product makes. A TTL set too long risks serving stale data (a cached LLM response for a prompt whose underlying source document has since changed; a cached product price that's now wrong); a TTL set too short defeats the purpose of caching in the first place, forcing expensive recomputation or re-fetching far more often than necessary. Choosing the right TTL per data type is a genuinely important design decision, not an afterthought — and it's common (and reasonable) for different pieces of data in the same system to have very different TTLs based on how often they actually change. How it works: in Redis, TTL is set directly on a key (`SETEX key 3600 value` sets a value that expires in 3600 seconds, or `EXPIRE key 3600` on an existing key), after which Redis automatically removes the key without any explicit deletion call from the application. In HTTP caching and CDNs, TTL is communicated via `Cache-Control: max-age=3600` headers, telling browsers and CDN edge nodes how long they may serve a cached response before re-checking with the origin. In Next.js\u002FNuxt's ISR (Incremental Static Regeneration), a page's revalidation interval is effectively a TTL on a rendered page. Choosing TTL involves a real trade-off matrix: highly volatile data (a stock price, live inventory count) needs a very short TTL or event-driven invalidation instead; rarely-changing data (a glossary term definition, a completed AI generation) can safely use a very long TTL, sometimes measured in days. Worked example: an AI SaaS caches LLM-generated product descriptions with a 24-hour TTL — long enough to avoid re-generating (and re-paying for) the same description on every page view, short enough that a merchant's price or feature update is reflected in the AI-generated copy within a day without needing to build explicit cache-invalidation logic tied to every possible source-data change. This TTL-only approach is a deliberate simplicity trade-off: the team accepts up to 24 hours of staleness in exchange for never having to build and maintain event-driven cache invalidation across every code path that could change a product's underlying data — a reasonable bet for a feature where near-real-time accuracy isn't a hard requirement.","TTL is the length of time a piece of cached or stored data remains valid before it automatically expires and is removed or refreshed.",null,[11,14,17],{"slug":12,"name":13},"cache","Cache",{"slug":15,"name":16},"cdn","Content Delivery Network (CDN)",{"slug":18,"name":19},"redis","Redis",[21,25,28,31,34,38,39,42,45,48,52,55],{"slug":22,"category":5,"name":23,"updated_at":24},"acid","ACID","2026-08-24T02:46:37+00:00",{"slug":26,"category":5,"name":27,"updated_at":24},"ann-search","ANN Search",{"slug":29,"category":5,"name":30,"updated_at":24},"backpressure","Backpressure",{"slug":32,"category":5,"name":33,"updated_at":24},"batch-processing","Batch Processing",{"slug":35,"category":5,"name":36,"updated_at":37},"bm25","BM25","2026-08-24T02:46:38+00:00",{"slug":12,"category":5,"name":13,"updated_at":24},{"slug":40,"category":5,"name":41,"updated_at":24},"cap-theorem","CAP Theorem",{"slug":43,"category":5,"name":44,"updated_at":24},"change-data-capture","Change Data Capture (CDC)",{"slug":46,"category":5,"name":47,"updated_at":24},"chroma","Chroma",{"slug":49,"category":5,"name":50,"updated_at":51},"chunk-overlap","Chunk Overlap","2026-08-24T03:30:02+00:00",{"slug":53,"category":5,"name":54,"updated_at":24},"columnar-storage","Columnar Storage",{"slug":56,"category":5,"name":57,"updated_at":24},"connection-pooling","Connection Pooling"]