To use KeyCDN as your CDN when using ShortPixel Adaptive Images, instead of ShortPixel's CDN, follow these steps:
- Create an account with KeyCDN if you have not already done so: https://www.keycdn.com
- Go to Zones to create a new zone.
- Enter the following data:
- Zone Name: "spaimg" for example, or whatever you feel it can represent this zone used to deliver your images through our plugin.
- Zone Status: active
- Zone Type: pull
- Origin URL: "https://no-cdn.shortpixel.ai"
- Image Processing: disabled
-
Expand the General settings and look for the SSL option. Select "letsencrypt".
- Save the new zone.
- Think about a name for the subdomain you want the images to be delivered from. For example, if your domain is mywebsite.com, you could choose
img
.mywebsite.com. If "img" is already used by another CNAME, think of something else, likeimages
.mywebsite.com ormedia
.mywebsite.com. - Go now to Zone Aliases and click on Add Zone Alias.
- Enter the alias you want, which will be what you have thought of in step #5. For example, "img.mywebsite.com". Remember that
mywebsite.com
should be changed to your actual domain. -
Choose the zone you created previously.
-
Go back to Zones and copy the zone URL.
-
In the DNS editor of your domain (ask your domain provider if you don't know where it is), add a new CNAME record from
img.mywebsite.com
to the zone URL.Remember that
mywebsite.com
should be changed to your actual domain. - Wait 5 minutes for your domain provider to complete all technical tasks in the background.
- Check with this tool if your CNAME is propagated correctly. If not, wait 24h-48h.
- Take any image URL from your website, append it to
https://img.mywebsite.com/spai/q_lossy+ret_wait/
and make sure that the new URL can be accessed. Example:- If your website is called mywebsite.com, your new CNAME is
img.mywebsite.com
, and your sample image ishttps://www.mywebsite.com/wp-content/uploads/2022/04/image.jpg
, - try to access this URL:
https://img.mywebsite.com/spai/q_lossy+ret_wait/https://mywebsite.com/wp-content/uploads/2022/04/image.jpg
- Can you view it without errors? Proceed to the next step.
- If your website is called mywebsite.com, your new CNAME is
- You have done everything on KeyCDN. Now go to your WordPress website and change the API URL of ShortPixel AI.
- Go to Settings > ShortPixel AI > Behaviour and enter
https://img.mywebsite.com/spai
in the API URL field. - Replace
mywebsite.com
with your actual domain name. -
Replace the
img
part if your subdomain is different, like configured above.
- Go to Settings > ShortPixel AI > Behaviour and enter
- Clear your WordPress cache: How to clear WordPress cache