QamoosTech
DevOps & CloudInfrastructureBeginner

TTL (Time To Live)

PronunciationTEE-TEE-EL

Definition

TTL (Time To Live) is how long a piece of data may be kept in a cache before it must be fetched again. A DNS record with TTL 3600 can be cached for an hour.

Where you hear it

In DNS settings, CDN and Redis caching rules, and before migrating a site.

Examples

  • Lower the TTL to 300 a day before we switch servers.
  • The Redis key expires after its TTL.
  • The session cache uses a TTL of 30 minutes, so old sessions expire on their own.

Common mistake

Leaving a long TTL before a change. Some users keep the old value for hours after the switch.

Don't confuse with

Cache invalidation, which removes an item on purpose. TTL is automatic expiry by time.

Say it at work

  • In a meeting or chatWhat TTL are we using?
  • In an email or ticketSet a short TTL for records that might change.