Safeguard
Developer Tools•

What do the TTL and Urgency headers do in web push?

TTL decides how long a push service holds your message, Urgency sets its priority. See the rules in RFC 8030 and how they affect stale alerts and battery.

Safeguard Security Team
3 min read

TTL tells the push service how many seconds to keep a message if the browser is offline, and it is required. Urgency marks priority from very-low to high and defaults to normal. Set a short TTL on time-sensitive alerts so a stale warning never arrives hours late.

Definition

Both are HTTP request headers your application server sends to a push service under RFC 8030, Generic Event Delivery Using HTTP Push.

TTL

The application server must include TTL, a number of seconds. A push service must respond with 400 if it is missing. The service may keep the message for less time than requested and reports the actual value, which must not exceed what you asked for. After TTL expires, it must not deliver the message. A TTL of zero means deliver only if the browser is available right then, otherwise expire.

Why this matters for security: a login approval, a one-time code notification or a fraud alert is wrong or even dangerous if it arrives hours late. A user who approves a stale prompt may approve the wrong thing. Match TTL to the life of the event.

Urgency

ValueTypical use
very-lowNewsletters, background updates
lowNon-time-critical updates
normalDefault when the header is absent
highTime-sensitive alerts such as security events

The push service must not forward Urgency to the browser. The browser can say what level it wants while monitoring, and the service must not deliver messages below it. Sending several Urgency values in one request produces a 400.

Delivery receipts and 410

A 201 response to a push request does not mean the message reached the browser. Receipts exist only if you ask for them. If you requested one and the browser never acknowledged the message, the service may send a 410 Gone failure on the receipt subscription. Do not confuse this with a dead subscription.

Suggested defaults

Message typeTTL ideaUrgency
Login approval or codeMinutes, no longer than the code's lifehigh
Security alertHourshigh
Order updateA day or sonormal
MarketingAs long as the offer is validlow or very-low

These are starting points to adjust, not rules from the RFC.

Steps

  1. Set TTL explicitly on every send, per message type.
  2. Match TTL to the validity of any code or approval in the message.
  3. Use high urgency only for events that justify waking a device.
  4. Do not rely on a 201 as proof of delivery; track opens or acknowledgments in your app.
  5. Pair with subscription handling rules so dead subscriptions are removed.

Where Safeguard fits

Safeguard's dependency scanning checks the push libraries you use against known advisories, and its policies help enforce review of notification code paths. The free scan is at https://gold.safeguard.sh/scan.

Quick check

Is TTL optional?

No. RFC 8030 says the application server must include it, and the push service must return 400 if it is missing.

Does a 201 mean the user saw it?

No. It means the push service accepted the request, not that the browser got the message.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.