CDN Setup for Media Delivery
Optimize media delivery for channels with large content libraries.
Overview
As your CastConductor channel grows with more videos, images, and audio files, you'll want to serve media through a Content Delivery Network (CDN) rather than directly from your web host. This provides:
- Faster load times — Content served from edge locations near your viewers
- Reduced server load — Offload bandwidth from your WordPress host
- Better reliability — CDN redundancy prevents single points of failure
- Lower costs — CDN bandwidth is typically cheaper than web host bandwidth
Recommended: Cloudflare R2
We recommend Cloudflare R2 for CastConductor media storage:
| Feature | Benefit |
|---|---|
| Zero egress fees | No charge for bandwidth (huge savings for video) |
| S3-compatible | Works with standard WordPress offload plugins |
| Global CDN included | Automatic edge caching worldwide |
| Generous free tier | 10 GB storage, 10 million requests/month free |
Pricing Comparison
For a channel serving 1 TB/month of video content:
| Provider | Storage | Bandwidth | Total |
|---|---|---|---|
| Cloudflare R2 | $0.015/GB | $0 | ~$15/month |
| AWS S3 + CloudFront | $0.023/GB | $0.085/GB | ~$100+/month |
| DigitalOcean Spaces | $5 flat | $0.01/GB (overage) | ~$15/month |
| Web host direct | — | ~$0.10/GB | ~$100/month |
Cloudflare R2 Advantage
With zero egress fees, R2 is especially cost-effective for video-heavy channels. You only pay for storage, not delivery.
Setup Guide: Cloudflare R2
Prerequisites
- A Cloudflare account (free tier is fine)
- Your WordPress site
- WP Offload Media plugin (Lite version is free)
Step 1: Create R2 Bucket
- Log in to Cloudflare Dashboard
- Navigate to R2 Object Storage in the sidebar
- Click Create bucket
- Name your bucket (e.g.,
my-channel-media) - Select Automatic for location (nearest to your viewers)
- Click Create bucket
Step 2: Create API Token
- In Cloudflare Dashboard, go to R2 Object Storage
- Click Manage R2 API Tokens
- Click Create API token
- Configure:
- Token name:
WP Offload Media - Permissions:
Object Read & Write - Specify bucket: Select your media bucket
- Click Create API Token
- Copy and save the Access Key ID and Secret Access Key (shown only once!)
Step 3: Enable Public Access
- In your R2 bucket settings, go to Settings
- Under Public Access, click Allow Access
- You'll get a public URL like:
https://pub-xxxxx.r2.dev
Or, for a custom domain:
- Click Connect Domain
- Enter a subdomain (e.g.,
cdn.yourchannel.com) - Cloudflare will configure DNS automatically
Step 4: Configure WordPress
- Install and activate WP Offload Media Lite plugin
- Go to Settings → Offload Media
- Choose Cloudflare R2 as your provider
- Enter your credentials:
- Access Key ID: From Step 2
- Secret Access Key: From Step 2
- Bucket: Your bucket name
- Region:
auto - Configure options:
- ✅ Copy Files to Bucket — Upload new media to R2
- ✅ Serve from R2 — Rewrite URLs to CDN
- Optional: Remove Local Files — Save disk space on your host
- Save settings
Step 5: Migrate Existing Media
- In WP Offload Media, go to the Tools tab
- Click Offload Existing Media
- Wait for migration to complete
All your images, videos, and audio files are now served through Cloudflare's CDN!
Quick Setup: Cloudflare Proxy (No Storage)
If you're already using Cloudflare for your domain and just want caching (no separate storage), you can enable CDN with zero configuration:
How It Works
- Your media URLs (e.g.,
yoursite.com/wp-content/uploads/video.mp4) already pass through Cloudflare - Cloudflare caches static files automatically
- Viewers get content from the nearest edge location
Optimize Caching
- Log in to Cloudflare Dashboard
- Go to Caching → Cache Rules
- Create a rule:
- If: URL path contains
/wp-content/uploads/ - Then: Cache eligible content, set Edge TTL to 1 month
- Deploy the rule
Limitations
This approach caches content but doesn't offload storage. Your web host still stores all files. For large libraries, R2 is the better solution.
Alternative: AWS S3 + CloudFront
If you prefer AWS or already use their services:
Step 1: Create S3 Bucket
- Log in to AWS Console
- Go to S3 and click Create bucket
- Name your bucket and select a region
- Uncheck Block all public access (or configure CloudFront later)
- Create bucket
Step 2: Create IAM User
- Go to IAM → Users → Create user
- Attach policy:
AmazonS3FullAccess - Create access key and save credentials
Step 3: Create CloudFront Distribution
- Go to CloudFront → Create distribution
- Origin: Select your S3 bucket
- Configure caching behaviors
- Create distribution and note the CloudFront URL
Step 4: Configure WordPress
- Install WP Offload Media plugin
- Select Amazon S3 as provider
- Enter your IAM credentials
- Set CloudFront URL as the delivery URL
Alternative: DigitalOcean Spaces
A simpler, fixed-price option:
| Feature | Details |
|---|---|
| Storage | $5/month for 250 GB |
| Bandwidth | 1 TB included, $0.01/GB overage |
| CDN | Built-in, 29 edge locations |
Setup
- Create a Space in DigitalOcean
- Enable CDN in Space settings
- Generate API keys (Spaces access keys)
- Configure WP Offload Media with the S3-compatible endpoint
CastConductor CDN Integration (Future)
Coming Soon
We're planning native CDN configuration in CastConductor Settings. This will simplify setup by:
- Built-in R2/S3 configuration fields
- Automatic URL rewriting for Roku app
- One-click media migration
For now, use WP Offload Media as described above.
Roku-Specific Considerations
Video Streaming
For HLS video streams (.m3u8), the CDN will cache both: - The manifest file (.m3u8) - The video segments (.ts files)
Ensure your CDN cache TTL allows for: - Manifest files: Short TTL (10-60 seconds) for live streams - Segments: Longer TTL (1 hour+) for VOD content
HTTPS Requirement
Roku requires HTTPS for all media URLs. Cloudflare R2 and all major CDNs provide HTTPS automatically.
CORS Headers
If your Roku app loads content from a different domain, ensure your CDN returns proper CORS headers:
Cloudflare R2 handles this automatically for public buckets.
Monitoring & Analytics
Cloudflare Analytics
- Go to Cloudflare Dashboard → R2 → Your Bucket → Metrics
- View:
- Total requests
- Data transferred
- Cache hit ratio
WordPress Media Library
After configuring offload, your Media Library will show which files are stored remotely:
- Cloud icon = Stored in R2/S3
- Local icon = Still on web host
Cost Estimation
Use this formula to estimate monthly CDN costs:
Cloudflare R2:
Storage: (Total GB) × $0.015
Bandwidth: $0
AWS S3 + CloudFront:
Storage: (Total GB) × $0.023
Bandwidth: (TB delivered) × $85
DigitalOcean Spaces:
Base: $5/month (250 GB storage, 1 TB bandwidth)
Overage: $0.02/GB storage, $0.01/GB bandwidth
Example: 50 GB content, 500 GB/month delivery
| Provider | Monthly Cost |
|---|---|
| Cloudflare R2 | $0.75 |
| AWS S3 + CloudFront | $43.65 |
| DigitalOcean Spaces | $5.00 |
Troubleshooting
Media Not Loading After Migration
- Check URLs: Ensure WordPress is rewriting to CDN URLs
- Clear cache: Flush WordPress and CDN caches
- Check permissions: Bucket must allow public read access
Roku App Shows Broken Images
- Verify HTTPS: All URLs must be HTTPS
- Check CORS: Ensure
Access-Control-Allow-Origin: *header - Check cache: Old URLs may be cached — regenerate app config
High Bandwidth Costs
- Enable caching: Increase cache TTL for static content
- Optimize video: Use appropriate bitrates (1080p only when needed)
- Use R2: Switch to Cloudflare R2 for zero egress fees
Next Steps
- Video & Audio Support — Configure your media content
- Scenes & Containers — Organize your channel layout
- REST API — Programmatic media management