CDN Settings
Complete guide to configuring all CDN types and options
Settings Page Overview
Location: WordPress Admin → 1 CDN Manager → Settings
The Settings page has 3 tabs:
- CDN Settings: Configure CDN URLs for each asset type
- Content Rewriting: Advanced URL rewriting rules
- Advanced: Versioning, caching, and other options
Tab 1: CDN Settings
Enable Origin URL
Type: Toggle + Text Input
Purpose: Set the original site URL for CDN replacements
When to use:
- If your site URL changes (development to production)
- For multi-environment setups (staging, production)
- To specify exact source domain for CDN rewriting
Example:
https://example.com
Enable Admin URL
Type: Toggle + Text Input
Purpose: Prevent CDN from being used in WordPress admin
When to use:
- To ensure admin area loads from local server
- For debugging issues in admin panel
- If CDN causes admin performance issues
Example:
https://example.com/wp-admin
Image CDN
Type: Toggle + Text Input
File Types: .jpg, .jpeg, .png, .gif, .svg, .webp, .ico, .bmp
Purpose: Serve all images from CDN for faster loading
URL Format:
https://img-cdn.example.com
How it works:
- Original:
https://example.com/wp-content/uploads/image.jpg - After CDN:
https://img-cdn.example.com/wp-content/uploads/image.jpg
Best practices:
- ✅ Use a subdomain: img-cdn.example.com or images.example.com
- ✅ Or use CDN provider domain: d1a2b3c4d5.cloudfront.net
- ✅ Ensure CDN points to your site's root directory
- ❌ Don't include trailing slash
Media CDN
Type: Toggle + Text Input
File Types: .mp4, .mp3, .webm, .ogg, .ogv, .avi, .mov, .wmv, .flv, .wav, .m4v, .3gp
Purpose: Serve video and audio files from CDN
Why separate from images?
- Media files are much larger (100MB+ videos)
- Different caching strategies needed
- Separate bandwidth monitoring
- Optimized CDN settings for streaming
URL Format:
https://media-cdn.example.com
Example transformation:
Before: https://example.com/wp-content/uploads/video.mp4
After: https://media-cdn.example.com/wp-content/uploads/video.mp4
CSS CDN
Type: Toggle + Text Input
File Types: .css
Purpose: Serve CSS stylesheets from dedicated CDN
Benefits:
- Faster stylesheet loading
- Reduced server load
- Better caching for styles
- Separate domain for parallel downloads
URL Format:
https://css.example.com
Example transformation:
Before: https://example.com/wp-content/themes/mytheme/style.css
After: https://css.example.com/wp-content/themes/mytheme/style.css
JavaScript CDN
Type: Toggle + Text Input
File Types: .js
Purpose: Serve JavaScript files from dedicated CDN
Benefits:
- Faster script loading
- Reduced server load
- Better caching for scripts
- Separate domain for parallel downloads
URL Format:
https://js.example.com
Example transformation:
Before: https://example.com/wp-includes/js/jquery.min.js
After: https://js.example.com/wp-includes/js/jquery.min.js
Fonts CDN
Type: Toggle + Text Input
File Types: .woff2, .woff, .ttf, .otf, .eot, .pdf, .zip, .doc, .docx, .xls, .xlsx
Purpose: Serve font files and documents from CDN
Why separate?
- Fonts require special CORS headers
- Different caching durations
- Can include other binary files (PDFs, ZIPs)
URL Format:
https://fonts-cdn.example.com
Example:
Font: https://example.com/wp-content/themes/mytheme/fonts/roboto.woff2
→ https://fonts-cdn.example.com/wp-content/themes/mytheme/fonts/roboto.woff2
PDF: https://example.com/wp-content/uploads/document.pdf
→ https://fonts-cdn.example.com/wp-content/uploads/document.pdf
Access-Control-Allow-Origin: * header for fonts to work
Frontend URL Replacement
Type: Toggle + Text Input
Purpose: Replace entire domain for all asset types not covered above
When to use:
- As a catch-all for any remaining files
- For complete domain replacement
- When you want all assets from same CDN
URL Format:
https://cdn.example.com
Priority order:
- Image CDN (if enabled and file is image)
- Media CDN (if enabled and file is media)
- CSS CDN (if enabled and file is CSS)
- JavaScript CDN (if enabled and file is JS)
- Fonts CDN (if enabled and file is font/document)
- Frontend URL (catches everything else)
Tab 2: Content Rewriting
Enable Dynamic Rewriting
Type: Toggle
Purpose: Advanced URL rewriting with custom rules
What it does:
- Scans page content for URLs
- Applies custom rewrite rules
- More aggressive than basic CDN replacement
Auto-Generate Rules
Type: Toggle
Purpose: Automatically create rewrite rules based on your CDN settings
When enabled:
- Plugin generates rules from your CDN URLs
- Updates automatically when you change CDN settings
- Saves manual rule writing
Aggressive Mode
Type: Toggle
Purpose: More comprehensive URL detection and replacement
What it changes:
- Scans inline CSS for URLs
- Rewrites JavaScript string URLs
- Processes JSON data
- More thorough but slower
Custom Rewrite Rules
Type: Textarea
Purpose: Define custom URL replacement rules
Format: One rule per line: old_url => new_url
Example:
https://example.com/old-path => https://cdn.example.com/new-path
/wp-content/themes => https://theme-cdn.example.com/themes
Tab 3: Advanced Settings
For detailed versioning documentation, see: Versioning Guide
CDN Versioning
See complete guide in Versioning Documentation
Quick summary:
- 5 independent version controls
- Image, Media, CSS, JS, Fonts versioning
- Uses
?1cdnver=VERSIONparameter - Forces browser to fetch updated assets
Enable CSS Caching
Type: Toggle
Purpose: Cache rewritten CSS files for performance
What it caches:
- CSS files with rewritten URLs
- Processed stylesheets
- Import statements
Cache location: /wp-content/cache/cdn1-css/
When to enable:
- ✅ Production sites
- ✅ High traffic sites
- ❌ Development environments (disable for immediate changes)
Custom Source Hosts
Type: Textarea
Purpose: Add additional domains to treat as source URLs
Format: One domain per line
When to use:
- Multi-domain WordPress installations
- Staging and production environments
- Custom domain mappings
Example:
staging.example.com
dev.example.com
example.org
Common Configuration Examples
Example 1: Simple Setup (All CDNs Same Domain)
Use Case: Using one CDN provider for everything
Image CDN: https://cdn.example.com
Media CDN: https://cdn.example.com
CSS CDN: https://cdn.example.com
JavaScript CDN: https://cdn.example.com
Fonts CDN: https://cdn.example.com
Result: All assets served from same CDN, simple to manage
Example 2: Optimized Setup (Separate CDN by Type)
Use Case: Maximum performance with specialized CDN for each type
Image CDN: https://img.cloudfront.net/d1a2b3c4
Media CDN: https://media.cloudfront.net/d5e6f7g8
CSS CDN: https://css.example.com
JavaScript CDN: https://js.example.com
Fonts CDN: https://fonts.example.com
Result: Granular control, separate domains for parallel downloads, type-specific optimization
Example 3: Subdomain Setup (Free/Easy)
Use Case: Using subdomains without external CDN
Image CDN: https://img.example.com
Media CDN: https://media.example.com
CSS CDN: https://css.example.com
JavaScript CDN: https://js.example.com
Fonts CDN: https://fonts.example.com
Setup:
- Create DNS records for each subdomain
- Point all to same server IP
- Configure server to serve from same root
Testing Your Configuration
- Save your settings
- Go to 1 CDN Manager → Tools
- Click "Test Connection" for each CDN type
- View your site in incognito mode
- Right-click → "View Page Source"
- Search for your CDN URLs to verify they're being used