CMS Integration with ProCDN

Browse by products and services

Applies to: ProCDN

Difficulty: Medium

Time: 60

Tools needed: None

Overview

The ProCDN works by caching static content on its worldwide network of servers. So how does this work with Content Management Systems (CMSs) like WordPress, Drupal, or Joomla? CMSs typically generate most of their content dynamically from databases. There are actually a few different ways to use the ProCDN effectively to boost your CMS-generated site, if it gets a fair amount of traffic - read below for details. If your server doesn't get many file requests, and you don't have any large static files being served, your speed increase will not be as dramatic.

READ ME FIRST

The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. (mt) Media Temple provides support for uptime and login access for the ProCDN product only, and our support agents cannot assist with any issues arising from use or setup.

Offload specific CSS, image, and JavaScript files

Hosting even a small number of static files on the ProCDN instead of on your host server can reduce server load and improve your website speed and responsiveness. When someone visits your web page, s/he doesn't just get one page - s/he has to request all of the linked images, CSS, and Javascript files from the server and download them to the browser. Your web server has to process each of these file requests. Additionally, most browsers can download only two files at a time, which means that even if each file is small, it adds to the wait time for the web page to load. Read on for a specific example.

Letâ€™s say that your main page has 10 images, 2 CSS files and 3 JavaScript files. When someone visits your website, your server starts with the single request for the main page. This page then gives the browser the links for the 10 images, 2 CSS files and 3 JavaScript files. Each individual file is then downloaded by and rendered in the browser. During this process, your web server gets a total of 15 HTTP requests, for which it uses 30 file handles (2 per request). Then depending on your browser, some of the files are downloaded simultaneously, and others queue up to download one after the other. Typically, two files per domain can be downloaded at the same time - so unless your web page uses only two files, this queueing can contribute quite a bit to your page load times.

On the other hand, if those 15 static files were hosted on the ProCDN, your host server would have to handle just the one initial page request (using 2 file descriptors), and the ProCDN would handle all the other HTTP requests, for which it is specifically optimized. From an HTTP request and file descriptor point of view, the server would be able to handle about 10 times as much traffic with the same resources. (Note that memory and CPU use would not see such a drastic increase in efficiency, because dynamic page generation typically uses more of those resources than static files do.)

TIP:

Check out the SymKat suggestions for how to use a WordPress plugin to capitalize on this type of configuration for your WordPress site, with minimal configuration required.

ProCDN-buffered dynamic site with low caching times

You can use the ProCDN in front of your entire website with a low caching time, so that dynamic pages are updated frequently in the ProCDN cache but can still take advantage of the extra-fast HTTP serving.

Specifically, you could add cache-control: max-age: 600 to your HTTP headers. This would signal the ProCDN to refresh the cached versions of your files every 10 minutes. If a 5 or 10 minute lag is acceptable for a blog post comment to show up, for example, this could be a great solution for you.

The ProCDN aims to be RFC 2616 compliant, and is compliant with RFC 2616 Section 14 specifically. The techniques for expiring that are documented at w3.org are valid for use with the ProCDN, including max-age and s-maxage.

This solution would work well for most blogs. However, it is NOT recommended for active wikis or forums.

See also

Final notes

There are other, more advanced CDN configurations that may work even better for your CMS-driven site. Please keep in mind that this product is aimed at our ProDev customers, and requires webmaster involvement and technical proficiency with DNS, HTTP web servers, and caching concepts. In the future, additional configurations may be provided in a simple package, but for now, please direct further questions to our forums.