Delivery & signed URLs

guide · updated 2026-09-30

Public URLs

Every file in a public collection is served at https://cdn.media-host.online/<collection>/<filename>. Filenames are kept as uploaded, with spaces turned into hyphens. Renaming a file keeps the old URL alive as a 301 for a year.

Responses carry Accept-Ranges: bytes, a strong ETag and Cache-Control: public, max-age=31536000. If you re-upload a file with the same name, the URL stays the same and edge caches are purged within about 30 seconds.

curl -I https://cdn.media-host.online/weekly-show/ep-048-final.mp3

HTTP/2 200
content-type: audio/mpeg
content-length: 58213904
accept-ranges: bytes
etag: "a3f1c0d9e77b1a2c"
cache-control: public, max-age=31536000
x-mh-edge: fra2

Signed URLs

Private collections are only reachable via a signed link. Generate one server-side, or ask the API to do it:

curl -X POST https://api.media-host.online/v1/files/f_7Q2kd9Lm/sign \
  -H "Authorization: Bearer $MH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expires_in": 86400, "download": false}'

# → { "url": "https://cdn.media-host.online/members/ep-048.mp3?exp=1759353600&sig=Mz1fA..." }

To sign locally without a round trip, compute an HMAC-SHA256 over path + "\n" + exp with your collection's signing secret and base64url-encode it. The CLI does this with mh sign. Expired links return 410 Gone, tampered links 403.

Custom hostnames

On the Network plan you can serve from your own hostname. Add a CNAME record pointing files.yourshow.example to edge.media-host.online, then register it:

mh domain add files.yourshow.example

A certificate is issued within a few minutes and renewed automatically. Existing cdn.media-host.online URLs keep working.

Download statistics

A download is counted when a client fetches at least 60 seconds' worth of audio (by bitrate) or 1 MB, whichever is smaller, from a given IP and user agent within 24 hours. This matches the way most podcast directories count. Known crawlers and prefetchers are excluded; the list is published and updated monthly.

curl "https://api.media-host.online/v1/stats/files/f_7Q2kd9Lm?from=2026-09-01&to=2026-09-30&by=day" \
  -H "Authorization: Bearer $MH_TOKEN"