The CDN rewrite option allows you to easily use third-party CDN providers on your WordPress site. Rewrite means that it will automatically change all of your assets’ URLs on the fly to use the CDN URL. This way, your assets will load from all of the global CDN POPs, instead of just your server.
A few popular CDN providers we recommend include:
If you’re using Cloudflare you don’t need to do anything in Perfmatters. Cloudflare is different than traditional CDN providers and sits between your site and the public internet. Traffic is automatically routed through Cloudflare, and it doesn’t require a custom CDN URL. Make sure to check out our documentation on recommended Cloudflare settings for the best performance.
Enable CDN rewrite
Follow the steps below to enable CDN rewriting of your URLs.
Click into the Perfmatters plugin settings.
Under the “Options” tab, click on the “CDN” sub-navigation menu.
Toggle on “Enable CDN Rewrite.” Note: Make sure to first configure your CDN URL.
Scroll down and click “Save Changes.”
Important: If you’re testing on a staging site, you’ll probably need to turn the CDN rewrite feature off temporarily as the CDN URL will only match your live site.