Skip to content

Caching and security

Wilkin Santana edited this page Nov 29, 2026 · 1 revision

This article explains part of Radio 2.0 in plain words. It is not normative: where it differs from the specification, the specification is right.

Caching and security in Radio 2.0 are the rules that keep manifests cheap to serve, safe to fetch and hard to abuse. They set how long a manifest may be cached, which addresses must use https, and the limits any server follows when it fetches a URL taken from someone else's manifest.

Defined in Specification section 10
Cache headers ETag, Cache-Control: max-age=300
Fetch limits 10 seconds, 256 KiB (64 KiB per event), 5 redirects, no downgrade to http
Tiers Production, Development
Status Draft

Caching

  • The manifest and schedule.json must be served with an ETag and should carry Cache-Control: max-age=300.
  • Consumers must send If-None-Match when they hold a copy, and should not fetch a manifest more often than every 5 minutes.
  • The event stream must not be cached. The poll address should carry a max-age of at most 5 seconds, and a consumer must not poll more often than every 5 seconds.
  • Public manifests, events and schedules should send Access-Control-Allow-Origin: *, so web players on other sites can read them.
  • A temporary outage should be answered with 503 and Retry-After, so directories do not drop a station during a short break.

Security tiers

Production. manifestUrl, homepage, events and schedule URLs must use https. Stream URLs should use https but may use http for older players and devices; a consumer that can use TLS should prefer an https stream of the same content. No URL in a production manifest, streams included, may name a development host. A validator reports one as an error, and a consumer skips the stream or link.

Development. A manifest is in the development tier when its manifestUrl, homepage, events or schedule URLs use http or name a development host. http is allowed only for these hosts: localhost, *.localhost, *.local, *.internal, *.test, loopback addresses, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and fc00::/7. A development-tier manifest is never verified; see Verification and ownership.

Fetching for others

A directory, or any server that fetches URLs taken from manifests, is an obvious target for requests aimed at internal networks. The rules say it must:

  • refuse development-tier addresses, and any address that resolves to one, unless it is configured for development;
  • follow at most 5 redirects;
  • stop after 256 KiB (64 KiB per event);
  • give up after 10 seconds.

The reference implementation enforces these limits and also refuses a downgrade from https to http. See Reference implementation.

Other security points in the standard

  • Text fields are plain text and must not be rendered as HTML.
  • Ownership rests on the homepage origin; see Verification and ownership.
  • Transmitter coordinates are optional so publishers can leave them out for privacy or security.

Reporting a vulnerability

Report problems in the library, the command line tool, the in-browser validator or the security rules privately through GitHub's "Report a vulnerability" on the repository Security tab. Do not open a public issue. Reports are acknowledged within 7 days. While the version starts with 0., only the main branch is supported.

Common mistakes

  • Using http for homepage or manifestUrl in production (the invalid files manifest--homepage-http-production.json and manifest--manifesturl-http-production.json fail).
  • Listing a development host such as localhost in a production stream URL (manifest--stream-dev-host-production.json).
  • Polling faster than every 5 seconds.

See also

References

Clone this wiki locally