How to set up a CDN for WordPress

Put Cloud CDN in front of WordPress: cache themes, media and anonymous pages, keep wp-admin on origin, then cut over DNS.

WordPress spends PHP on the same CSS, uploads and anonymous HTML thousands of times per hour. Cloud CDN should take that traffic. wp-admin, login and checkout should not follow it into cache.

Connect the origin, not the plugin first

Create a Cloud CDN distribution that pulls the existing WordPress host over HTTPS, including wp-content/uploads and public permalinks. Prove theme assets and a post URL on an Aptranet hostname before you install another caching plugin.

Most cache, SEO and media plugins keep working at origin. The CDN is in front of the hostname, not inside PHP.

Bypass the paths that own state

wp-admin, wp-login.php, wp-cron.php and any membership or checkout path must bypass cache. Anonymous posts, the homepage and the uploads directory are the cache.

If a page cache plugin already emits Cache-Control, honour it or set CDN TTLs that you can purge on publish.

Media without a second pipeline

Convert and resize uploads at the edge instead of storing every WebP derivative in the media library. Purge the URL when an editor replaces a file.

See CDN for WordPress and CDN image optimization for the product mapping.

Cut over the public name

Map the domain, attach a managed or custom certificate, and point DNS when the test hostname is boring. Purge after plugin or theme releases.

Flatten the apex if the site is on example.com. Cloud DNS CNAME flattening is the usual way.

Frequently Asked Questions

Not to pull the origin. A plugin can rewrite asset URLs, but many sites simply put the whole public hostname on Cloud CDN.

Not if you bypass on the authentication cookie. Public pages stay cached for anonymous readers.

Purge the post URL, the homepage and any listing that includes it, or keep a short HTML TTL.

Put this on Cloud CDN.

Get started with our Management Console in less than 2 minutes, or connect with an expert to supercharge your business today.