2026-04-16

Secure Sharing

What Is Message TTL and How to Set It Wisely

TTL — Time To Live — is the expiry window on a secure message. Setting it wrong in either direction has real security consequences.

Clock representing time-limited access

Message TTL — your first line of access control

An expired link is an inaccessible link. TTL turns time itself into a security boundary.

TTL — Time To Live — is the duration after which a secure link becomes permanently inaccessible, regardless of whether it was ever opened. It is not just a convenience feature; it is a hard security boundary. An expired link cannot be opened, forwarded, or replayed — even if the URL is intact.

Short TTL (5–30 minutes) is the right choice for one-time credentials: temporary passwords, two-factor recovery codes, or API keys being handed off during a deployment call. The window is long enough for a real recipient in the same conversation, short enough to be useless if intercepted minutes later.

Medium TTL (24–72 hours) suits asynchronous workflows where the recipient may be in a different timezone or needs time to act: a contract draft to review, a salary figure shared with HR, or access credentials for a staging environment.

Long TTL (30–90 days) is appropriate for slower processes — legal document review, a new hire onboarding package, or a shared secret that a small team needs to access once during a project quarter.

The main mistake teams make is choosing TTL based on habit instead of exposure. If a secret is useful for 15 minutes but remains retrievable for 30 days, the real access policy is 30 days, not 15 minutes. TTL should mirror the operational lifetime of the information, not the convenience of the sender.

For any credential being actively used: combine TTL with burn-after-reading. Two independent destruction paths — time and first open — mean the secret cannot survive longer than necessary under either scenario.

Use cases

How to match TTL to the real workflow

The main TTL mistake is not failing to use it. It is choosing it automatically, without mapping it to the actual lifetime of the information being shared.

1

One-time passwords and recovery codes

If the recipient is waiting in the same conversation, choose minutes, not days. The secret is only useful for a brief step, so the access window should end as soon as that step is realistically complete.

2

Async document review and HR workflows

For contract drafts, salary details, or onboarding files, hours or 1–3 days usually make more sense. The recipient needs working time, but there is rarely a good reason for the link to remain live for weeks.

3

Small-team shared secrets

If several people genuinely need the same secret during a project phase, let the TTL cover only that phase. Long-lived access without context quickly turns secure sharing into an accidental password archive.

Questions about TTL

What happens to the message data when TTL expires?

Short-lived messages (≤24h) are stored in Redis with a native TTL — Redis deletes them automatically at expiry. Long-lived messages are stored in PostgreSQL and a cleanup job runs every hour to delete records where expires_at has passed.

Can I extend a TTL after sending the link?

No. The TTL is set at creation and cannot be modified. If the recipient needs more time, create a new secure link with a longer window.

Should I always set the shortest possible TTL?

Shortest-possible is the safest default, but only if it is realistic for your recipient. A link that expires before your recipient checks their messages defeats the purpose. Match TTL to your real-world communication pattern.

Is TTL a substitute for encryption?

No. TTL limits how long a secret remains accessible. Encryption controls who can read it while it exists. Good secure sharing uses both: encryption for confidentiality and TTL for exposure reduction.

Keep reading

More in Secure Sharing

All articles