Can I use a different CDN with your service?

If you're interested in using a different CDN when serving optimized images from ShortPixel via ShortPixel Adaptive Images or Autoptimize, then please:

  1. Edit your DNS records and add a CNAME from your-cdn.example.com to no-cdn.shortpixel.ai

    1. If you're using ShortPixel Adaptive Images, please go to ShortPixel Adaptive Images settings, to the Advanced tab and change the API URL from https://cdn.shortpixel.ai/spai to https://your-cdn.example.com/spai.
    2. If you're using Autoptimize: In your WordPress plugin add a code snippet (see the example below). To add a code snippet you can use a plugin like this one.

add_filter("autoptimize_filter_imgopt_base_url","use_my_own_cdn");
function use_my_own_cdn($urlIn) {
return str_replace("cdn.shortpixel.ai","your-cdn.example.com",$urlIn);
}

Note: the filter name changed since version 2.5 of Autoptimize.

Here's an example of how the DNS configuration looks like when using Cloudflare:

  1. Enter your Cloudflare account
  2. Select the DNS tag from the top menu

  3. Add a new record following this example:

  4. "example-cdn" should be changed to whatever you wish. Make sure the cloud is yellow so you can use the CDN features offered by Cloudflare

Still need help? Contact Us Contact Us