# Cloudflare Worker: linearvoid-media (edge HLS delivery) # Serves HLS objects from the `linearvoid-media` R2 bucket on media.linearvoid.tv. # Applies immutable caching to media segments and a short TTL to live manifests. # This worker replaces direct R2 custom-domain serving on the media host so cache # headers/CORS are controlled in code (cache rules remain as the origin baseline). name = "linearvoid-media" main = "src/worker.js" compatibility_date = "2025-08-01" # R2 bucket holding the HLS objects. The request path is mirrored onto the bucket, # e.g. GET /hls/playlist.m3u8 -> object key `hls/playlist.m3u8`. [[r2_buckets]] binding = "MEDIA_BUCKET" bucket_name = "linearvoid-media" # Default environment: deploy to the preview *.workers.dev URL (test target). # npx wrangler deploy # # Production environment: attach the media host as a custom domain on this worker. # npx wrangler deploy --env production [env.production] routes = [ { pattern = "media.linearvoid.tv", custom_domain = true } ]