Web Push Notification Headers Reference

TTL, Urgency, Topic headers for Web Push with VAPID Authorization format.

Reference for RFC 8030 Web Push request headers — TTL, Urgency, Topic and Content-Encoding — and the RFC 8292 VAPID JWT Authorization scheme used when sending to a push service.

What does the TTL header do?

TTL (Time To Live) is a required header giving the number of seconds the push service should retain the message if the device is offline. TTL: 0 means deliver immediately or drop. A larger value lets the push service hold and retry delivery until the device reconnects or the time expires.

The Web Push protocol headers

Web Push (RFC 8030) lets an application server deliver a notification to a user agent through an intermediary push service, addressed by the subscription’s endpoint URL. A handful of request headers control retention, priority and de-duplication, and VAPID (RFC 8292) authenticates the sender. This reference covers those headers and the Authorization format.

How it works

The application server sends a POST to the subscription endpoint with an encrypted payload and the control headers; the push service stores or relays it to the device:

POST /push/abc123 HTTP/1.1
Host: push-service.example
TTL: 86400
Urgency: high
Topic: chat-42
Content-Encoding: aes128gcm
Content-Type: application/octet-stream
Authorization: vapid t=<signed-JWT>, k=<base64url-public-key>

<encrypted binary payload>

TTL is mandatory and sets how long the message is retained for an offline device. Urgency and Topic are optional: urgency influences battery-aware delivery, and topic lets a later message replace an undelivered earlier one. The VAPID JWT, signed with your ECDSA P-256 key, proves the sender’s identity.

Tips and notes

  • TTL is required even for immediate delivery — use TTL: 0 for fire-and-forget.
  • Set Topic to collapse rapid updates into the latest notification.
  • VAPID JWT exp must be at most 24 hours in the future or the push service rejects it.
  • Payloads are encrypted end-to-end; the push service cannot read them.