Website Without PHP
US
Menu

CDN

Also known as: content delivery network

A CDN is a network of servers around the world that keeps copies of your website close to your visitors, so pages load fast wherever they are.

Static sites Last updated:

A CDN is a network of servers around the world that keeps copies of your website close to your visitors, so pages load fast wherever they are. Your own server does less work, and pages and files usually reach visitors faster, because the distance they travel is shorter. For many sites a CDN is the simplest way to improve loading speed without touching the code.

What is a CDN?

CDN stands for content delivery network. It stores copies of your site and serves each visitor from a server nearby.

Without a CDN, every visitor connects to your one hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. server, wherever they are. With a CDN, copies of your files are kept on many servers, called edge locations. When someone opens your site, the CDN checks whether it has a fresh copy close by. If it does, the copy is served immediately. If not, the CDN fetches the file from your server, passes it on and keeps a copy for next time.

How long a copy is kept depends on the rules you set, often through headers that tell the CDN and browsers how long a file stays valid. Setting those rules well is a large part of using a CDN well, and it ties directly to how you handle your cacheA cache is a store of ready-made copies, such as finished pages, so a website or browser can show something instantly instead of building it again..

What a CDN means for your PHP site

On a PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. or WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. site, a CDN can take over images, stylesheets and scripts, and often cached copies of whole pages. That reduces the number of requests that reach PHP and the database. Requests that cannot be cached, such as a checkout or a logged-in screen, still go all the way to your server.

This is a gain, but it does not remove the application. The PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing., plugins and themeA WordPress theme is a ready-made package that decides how your WordPress site looks and how its pages are laid out. Change the theme and the design changes. behind it still need updates, and a CDN does not close a vulnerabilityA vulnerability is a weakness in software that an attacker can use to do something the software was never meant to allow, such as reading private data. in them. Some providers filter abusive traffic, which can lower the load, but that is an extra layer, not a repair.

A static websiteA static website is made of ready-made page files that the server hands over as they are, with no PHP code or database working behind the scenes. pairs naturally with a CDN. Because every page is a finished file, the CDN can hold the whole site, and visitors never reach an application server at all. That is a smaller attack surfaceThe attack surface is the total of all places where an attacker could try to get in, such as logins, forms, plugins and the code on your server., though your CDN account, DNS settings and build process still need to be protected. Your DNSDNS is the internet's phone book: it looks up a domain name, such as yourcompany.com, and tells browsers which computer holds that website. records decide which CDN receives the traffic, so keep access to them tight.

How to check what a CDN does for you

Open your site in a browser, open the developer tools and look at the response headers of a page and an image. Many CDNs add a headerAn HTTP header is a short line of extra information that a browser and a website send each other with every page request, invisible to the visitor. that tells you whether the response came from the cache. Run a page speed test from more than one location, and compare before and after. Also check what happens after you change content: how soon does the new version appear, and who can clear the cache?

Make sure personal pages are not cached for other people. A cart or an account page must never be served from a shared cache.

CDN and edge code

Some CDNs can also run small pieces of code on their servers, known as edge computingEdge computing means running small bits of code on servers close to the visitor, instead of on one central server far away.. That lets you add small dynamic features, like redirects or a form handler, without running a server of your own.

When to act

Act when your pages load slowly for visitors far from your server, when traffic spikes put strain on your hosting, or when you are moving to a static site. A move away from PHP is a good time to choose the CDN deliberately. Our WordPress to static site service sets up a static site on one.

Frequently asked questions

What does a CDN do?

A CDN keeps copies of your files, such as pages, images and scripts, on servers in many locations. When someone visits, the copy closest to them is served, so your own server does less work and the page usually arrives faster.

Does a CDN replace my hosting?

Not for a dynamic site. The CDN sits in front of your server and stores copies. For a static site, the files can live on the CDN itself, so a separate application server is not needed.

Can a CDN serve a WordPress site?

Yes, for files such as images and styles, and for cached copies of pages. Anything that changes per visitor, such as a cart or a logged-in view, still has to reach the origin server and run PHP.

Is a CDN a security measure?

Many CDN providers add protections such as filtering of abusive traffic. That helps, but it does not repair vulnerabilities in your own software, so you still need to keep PHP and plugins updated.

Related pages

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login. We keep the domain and the result, never your IP address.