Why might your WordPress site remain slow even after setting up a CDN? Because using a CDN with WordPress isn’t a quick-fix solution in itself: the result depends on the coordinated operation of the content, DNS and hosting. A CDN can deliver images, style sheets and other static files from servers closer to visitors, thereby reducing the latency caused by geographical distance. However, it does not replace database operations or dynamic requests, nor does it replace your WordPress hosting.
It is understandable if you have concerns about the order of the settings, or if you suspect there might be an HTTPS error or outdated cached content. For secure operation, it is important that the settings for DNS, the CDN and the WordPress cache are consistent with one another.
In this guide, we’ll walk you through what a CDN speeds up, how to integrate it with your WordPress site, and how to check that your content and encrypted connection are working properly. We’ll also provide tips on identifying and troubleshooting common errors, and discuss when it’s worth examining the performance of your hosting or configuration separately.
What does a CDN do on a WordPress site, and what does it not speed up?
A CDN is a network of servers operating in multiple geographical locations that delivers cacheable content to visitors. The abbreviation comes from the English term ‘Content Delivery Network’; this overview of the Content Delivery Network (CDN) also explains the technology’s role on the internet. On WordPress sites, images, CSS files, fonts and JavaScript files are often cached on a CDN.
To understand how it works, it is worth distinguishing between three roles. The original server, also known as the source server, is the backend server where the website’s original files and data are stored. This task is usually handled by the WordPress hosting provider. The CDN’s edge servers can store and serve certain content closer to visitors. A CDN therefore complements the hosting service; it does not replace it.
How does WordPress content reach visitors via a CDN?
When someone opens the page, the DNS maps the domain name to the correct network address. Depending on the CDN configuration, modifying the DNS records or name servers can redirect requests to the CDN network. The edge server checks whether it has the requested, cacheable file. If so, it can deliver it to the visitor; if not, it can retrieve it from the origin server and then cache it in accordance with the rules.
The exact process and the terminology used in the control panel may vary depending on the CDN provider. Therefore, always follow the relevant provider’s current instructions before making any changes to your DNS settings. When using a CDN with WordPress, it is particularly important to ensure that the existing settings for your domain and hosting remain consistent.
What performance issues can a CDN help to resolve?
A CDN can primarily reduce the loading time of static files, as it delivers content from a server that is geographically closer to the visitor. This can be useful if the site uses a lot of images or other large static files, or if visitors are located far from the original server. The result depends on the website’s content, the visitors’ locations, the network path and the caching rules; therefore, do not expect a predetermined speed improvement without first carrying out measurements.
A CDN does not automatically fix slow WordPress code, resource-hungry plugins or slow database queries. Such requests often continue to place a load on the original server. If your dynamic pages or admin panel are slow, check the code, the database and the performance of your WordPress hosting separately.
CDN, WordPress cache or better hosting: which one do you need?
The right caching solution depends on where the delay occurs. A CDN helps with content delivery and distribution, caching can reduce the need for repeated processing, and hosting provides the server resources required for WordPress to run. These are complementary layers, not alternatives to one another.
| Solution | Main task | When might this be useful? |
|---|---|---|
| CDN | Distributing and serving cacheable files from servers closer to visitors. | If accessing static content or geographical distance causes a delay. |
| Cache | The temporary storage of previously generated data or pages, so that everything does not have to be reprocessed for every request. | If server-side processing of repeated page loads can be reduced. |
| WordPress hosting | Running the website’s files, database and dynamic processes. | If the server’s resources or the serving of dynamic pages are causing a bottleneck. |
The location of the cache also matters. The browser cache can store certain files on the visitor’s device, so that on a return visit, not everything necessarily needs to be downloaded again. A WordPress plugin can manage the caching of pages or other data. Server-side caching can store generated content within the hosting environment. Exact behaviour depends on the tool used and the settings. Google’s technical guide on CDNs provides further insights into understanding network delivery and caching.
When can a CDN help, and when should other issues be addressed first?
If it is mainly images, style sheets or other static files that are loading slowly, or if visitors are located far from the original server, it may be worth trying a CDN. However, if the slowdown is linked to a complex plugin, faulty code or slow database queries, a targeted performance audit is required first. If you notice signs of a lack of resources, you should also review your hosting environment.
How does a CDN fit in with WordPress hosting?
A CDN does not replace your original WordPress hosting. The hosting provider runs WordPress, manages the database and serves requests that the CDN does not cache. A CDN can complement this work by distributing content that has been set up correctly. You can read more about the role and capabilities of hosting in our guide to web hosting for WordPress sites. Using a CDN with WordPress does not, in itself, mean that your hosting plan includes a CDN.
Setting up a CDN for WordPress: preparations before changing the DNS
Before changing your DNS settings, create a restorable backup. Save your WordPress files and database, and make a note of your current DNS records. This will make it easier to identify any changes and restore your previous settings should a problem arise.
What sort of access and backups will you need?
Using a CDN with WordPress can involve several different interfaces. Before setting it up, check that you have access to your WordPress admin panel, your domain’s DNS management interface and your hosting control panel. If you do not manage your DNS with the same provider as your hosting, you will also need access to that provider’s account.
Before making any changes, create a full backup that includes both the website files and the database. To restore your site, make a note of or save your current DNS records. Record the record type, name, target value and TTL setting, as well as which account or provider you use to manage the domain. Store your backups in a location that is inaccessible to unauthorised persons.
- WordPress: check that you can log in to the admin panel.
- DNS: create a backup of your current records before making any changes.
- Hosting: make sure you have access to the interface required for managing files and databases.
What WordPress settings should you check beforehand?
First, make a note of the website addresses specified in WordPress and check that the site loads correctly over an HTTPS, encrypted connection. Try logging into the admin panel, then test the important forms. Also make a note of any active caching solutions, as multiple conflicting rules can lead to outdated or incorrect content being displayed.
To start with, check the page’s images, CSS and JavaScript files, as well as the mobile view. This will allow you to compare performance with the previous state once the CDN has been set up. If you are using a plugin to connect to the CDN, check its settings and compatibility information against the latest documentation provided by both the plugin and the CDN provider.
Before modifying your DNS settings, always follow the current instructions provided by your chosen CDN provider. The records and the configuration process may vary from provider to provider. Do not delete or overwrite any records based solely on general instructions. First, check that the change in question is suitable for both your domain and your email.
Connecting a CDN to WordPress and checking the settings
When enabling the CDN, handle the provider account settings, DNS changes and WordPress checks separately. The names of the interfaces and the necessary steps may vary from provider to provider. Check each record against the current documentation for the relevant CDN provider. Do not use generic record values, as this may cause incorrect redirection or service outages.
In what order should you carry out the CDN setup?
- Add the domain to your CDN account. Follow your provider’s instructions and check that the domain you’ve entered matches the address of your WordPress site exactly.
- Check the recognised DNS records. Compare the data displayed by the provider with the current records and any values you saved earlier. Pay particular attention to ensuring that the settings for the domain and any subdomains are correct.
- Carry out the documented DNS changes. Only modify the records listed in your provider’s current guide. Do not delete any other settings, such as those used for email, unless specifically instructed to do so in the documentation.
- Please wait until the provider confirms the configuration. Then test the website. Only enable any additional caching or WordPress plugin settings if the solution in question requires them.
You do not always need to install a CDN plugin. If your provider or chosen integration requires WordPress-side configuration, check the plugin’s documentation and the CDN compatibility guide. Avoid having multiple tools simultaneously rewriting file paths or managing the same cache.
How can you check that your CDN is working properly?
The use of a CDN with WordPress can be considered correctly configured if the website and its key functions continue to work properly after the changes have been made. Open a new, logged-out session and test the site in a desktop browser, then on a mobile device as well. You can view the requests and response headers in the Network tab of your browser’s developer tools. Interpret the cache headers according to the CDN’s documentation, as the names and labels may vary from provider to provider.
Post-setup checklist:
- The homepage and a few important subpages are loading.
- The HTTPS connection is error-free, and no warning indicating insecure content is displayed.
- Images, fonts and style sheets are displayed correctly.
- Forms and dynamic features, such as search and login, are working.
- You can log in to the WordPress admin panel and use the control panel.
If you get stuck during setup or troubleshooting, have a look at your hosting provider’s knowledge base for relevant technical guides.
CDN errors in WordPress: caching, HTTPS and restoration
An error occurring after setting up a CDN can stem from several sources: the browser, the WordPress cache, the CDN itself, the DNS settings or the hosting provider. The symptom provides a clue, but does not in itself prove where the problem lies. When using a CDN with WordPress, you should therefore change only one setting at a time and check the relevant functions after each step.
What should you do if the page displays incorrectly after making changes?
First, identify exactly what is wrong. If images are missing, check the file paths and ensure the CDN can access them. If the page layout has changed, check whether the CSS files are loading. A JavaScript error may affect certain interactive features, whilst missing fonts may alter the appearance of the text. These are possible causes, not definitive diagnoses.
In the event of an HTTPS error or browser warning, check the certificate and the settings for the encrypted connection between the CDN and the origin server. The exact method of verification is specified in the provider’s guide. Test the homepage, the WordPress admin panel and any forms separately.
If content is out of date, previous versions may be stored in several locations. Only clear the cache of the CDN, hosting provider or WordPress plugin on the relevant layer, and follow the instructions in the documentation provided by the relevant service provider or plugin. Then reload the page, preferably in a new browser session. If clearing the cache of a single layer resolves the error, it will be easier to pinpoint the cause.
When should you reset your DNS, and when should you ask your hosting provider for help?
If your website is not working properly and you are unable to pinpoint the source of the fault through troubleshooting, consider reverting to your previous DNS settings. To do this, use the records you saved before the change and follow your CDN provider’s restoration guide. Do not restore records at random, as this may affect other services, such as email.
If the site is slow or malfunctioning even without a CDN, or if you need to check the settings related to your hosting, continue troubleshooting via your hosting control panel. For related instructions, please consult the aWh knowledge base. Make a note of the error message, the page in question and any changes you have made so far, as these may help to pinpoint the problem more accurately.
Not a WordPress site?
A CDN can be set up for any website; the steps are the same: either the CDN provider manages the entire domain on its own name servers (in which case the DNS records must also be transferred to it), or it serves the static files from a separate subdomain (for example, cdn.cegnev.hu). It works on both cPanel hosting and VPS. If your visitors come almost exclusively from Hungary, and your site does not use many large images or videos, caching on the hosting server and image optimisation often yield better results than a CDN; our image optimisation guide covers this.
Build a faster WordPress site with these well-thought-out steps
A CDN can improve access to static content, but it is no substitute for WordPress hosting and does not automatically resolve issues caused by slow code or database problems. Using a CDN with WordPress therefore provides the full picture when combined with the appropriate caching and a review of your hosting.
The basis of a secure configuration is to back up your files, database and DNS records beforehand. After making changes, check the HTTPS connection, static files, forms and the WordPress admin panel. If an error occurs, check one setting at a time and follow the CDN provider’s documentation.
If you’d also like to find out more about the hosting performance: aWh’s WordPress hosting plans run on NVMe SSD storage, with HTTP/2 and daily backups.
Our knowledge base article describes the steps to be carried out on aWh’s hosting service: Speeding up your website using a CDN.
Frequently asked questions about WordPress CDN
What is a CDN, and how does it work with a WordPress site?
A CDN is a network of servers operating in multiple geographical locations, which can deliver cacheable content to visitors. On a WordPress site, such files might include images or style sheets. Depending on the DNS settings and the CDN configuration, a visitor’s request may be routed to one of the servers in the network. If the file in question is available there, the CDN will serve it; otherwise, it may retrieve it from the origin server.
How do I set up a CDN for WordPress?
Using a CDN with WordPress usually begins by creating an account with the provider and adding your domain. Next, check the DNS settings required by the provider and only amend the records in accordance with the latest documentation. Before doing so, back up your website’s files, database and current DNS settings. Once the setup is complete, test the HTTPS connection, the homepage, the images and the admin panel.
Is a WordPress plugin required to use a CDN?
A WordPress plugin is not strictly necessary to use a CDN. Some providers route traffic via DNS changes, whilst other solutions may require WordPress-side configuration or a plugin. Please check the documentation for your chosen CDN. If you install a plugin, check the compatibility information and avoid having multiple tools simultaneously modifying the file paths or caching rules.
Does a CDN replace WordPress hosting or caching?
No. WordPress hosting ensures that the website’s files and database function correctly, whilst a CDN can help with the retrieval and distribution of cacheable content. Caching is a separate function: it can operate in a browser, as a WordPress plugin or on the server side. The three solutions can complement one another, but none automatically replaces the other. If you have slow dynamic pages, check both your hosting and your code.
Why aren’t the changes appearing after enabling the CDN?
It is common for the browser, WordPress plugin, hosting provider or CDN to still be serving an older version of the file. First, reload the page in a new browser session, then check which caching layer is affected. Clear the relevant cache according to the provider’s or plugin’s instructions. If this does not help, check the file’s path and the CDN settings.
Is it safe to use a CDN on a WordPress site?
Using a CDN on its own does not guarantee comprehensive website security. Security depends on the provider’s settings, the protection of the origin server, access management and the proper functioning of HTTPS. Before setting it up, read the provider’s security and data management policy. Check that the connection between the domain and the origin server is also properly encrypted, then test the administration panel and forms.
How can I check whether my WordPress site is actually using a CDN?
You can check where images, style sheets and other static files are being loaded from in the Network panel of your browser’s developer tools. Response headers can also provide clues, but their interpretation may vary depending on the CDN provider, so please cross-check them against the provider’s documentation. Test whilst logged out, and check the homepage, the HTTPS connection, forms and the admin panel as well.
Take a look at aWh’s WordPress hosting solutions and choose a starting point that suits your website’s needs.