Can I use a different CDN with ShortPixel Adaptive Images?
Important note: ShortPixel Adaptive Images works correctly out-of-the-box, so configuring it to work with your own CDN should only be done by advanced users.
If you want to use a different CDN than the default cdn.shortpixel.ai when using ShortPixel Adaptive Images, then please:
- Edit your DNS records and add a CNAME from cdn.your-domain.com to no-cdn.shortpixel.ai
- On the previous URL, replace "your-domain.com" with your actual domain name.
- If "cdn.your-domain.com" is already being used on your DNS records, you can change it for whatever you want, like "images.your-domain.com" or "img.your-domain.com".
- In the ShortPixel Adaptive Images Settings page - Advanced tab - API URL field, make the following change, replacing "your-domain.com" with your actual domain name:
Please note that if you're not using Cloudflare as CDN then your CDN should be able to handle the SSL certificate so you can have the CDN URL with https. If they cannot handle this, a certificate error will occur and only http will work. Also, in case your CNAME is something else like "images" or "img" (following the previous example), make sure to also put it here instead of "cdn".
- Enter your Cloudflare account
- Select the DNS tag from the top menu
- Add a new record following this example
"cdn.your-domain.com" can be changed to whatever you wish. Make sure the cloud is yellow so you can use the CDN features offered by Cloudflare
Important: after setting up your own CDN make sure the new record works as expected with an online tool like this one https://www.whatsmydns.net/