feat: R2 CDN caching via custom domains + CacheControl headers (#1278)
* feat: add CacheControl headers to R2 uploads, consolidate S3 client config
Set Cache-Control: public, max-age=31536000, immutable on all R2 uploads
(audio, images, thumbnails). Objects are content-hashed so they never
change — this tells Cloudflare's CDN and browsers to cache aggressively.
Also consolidate the S3 client connection config into _s3_client() helper
method. The same 5-line endpoint/credentials block was repeated 9 times.
Now it's one method, making an S3/R2 swap a one-line change.
Prep for switching from r2.dev URLs (no CDN caching) to custom domains
(audio.plyr.fm, images.plyr.fm) which are already provisioned.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: update R2 references for custom domain CDN migration
Replace r2.dev URLs with custom domain URLs (audio.plyr.fm,
images.plyr.fm) in public docs, internal docs, and config examples.
Drop "R2" from "R2 CDN" references — the CDN is Cloudflare's edge
cache, not R2 itself.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
authored by