You got a growing blog? Is your server not powerful enough to support it anymore? Is it getting slower every day? Have you tried to do everything you can like minifying your scripts, adding css sprites and even caching your site? Did they work? Right now you might be out of tricks and thinking about moving to another server. But, there’s another trick you can use… Why not host the static part of your website in a Content Delivery Network (CDN)? It will not only take some of the load off your server, but it will also give a performance boost to your site!
A CDN will allow you to store your data in several servers distributed around the world so if some one tries to access your site, the content which you have uploaded to the CDN will be served from the nearest server! If that data is located in your server, every client have to go to that server to access your data, some may be close but others might be at the other end of the world. So, a CDN can save a lot of time by serving the files from a server which is closer to the client.
Ok, now the next question is… Is a CDN cheaper than going for a VPS or a Dedicated Server? Of-course it’s very cheap. Most of the CDN services charge only for what you use. For example, Rackspace charge only 15 cents per GB per month (for storage). For bandwidth out, they’ll charge 18 cents per GB per month. Recently, I switched to Rackspace Cloud Files . For me, I only pay about $3 per month. Actually, it depends on how much you use their service.. So, before you start, use their price calculator to know how much you have to pay.
Setting up RackSpace Cloud files and WordPress
So, done setting up your mind? Then, let’s go ahead and add Rackspace Cloud Files to your WordPress blog. It’s a bit easy, you don’t have to know any coding stuff. We are going to use W3 Total Cache Plugin to help us :
- First of all, signup for Rack Space Cloud Files. Sometimes, they’ll want to verify your account and they’ll try to call you. So, remember to put a working phone number!
- Next, login to the cloud control panel. You will be using this control panel to manage all Rackspace cloud based services.
- Now, got to Hosting > Cloud Files as shown in the image below. In here, check whether you get a message saying that you have to activate cloud files. If you get one, click on it to activate cloud files. If you can’t see any message, you’re good to go!
- Next, go to Your Account > API Access. Here you’ll find the API key. Click on Show Key and copy it (For example, copy it to notepad).
- After you get the API key, you’re done with Rackspace. Next, head over to your wordpress blog and install the development version of W3 Total Cache plugin. It’s very important to use the development version because Rackspace have recently switched to Akamai and their URL format have been changed. The current version of Total Cache won’t support this URL format! (First, go to W3 Total Cache and click on other versions link located in the right side of the screen. Next click on the Development Version at the bottom and download the zip file. Now go to your admin area, under plugins, click Add New. Next go to Upload link located at the top of the add new plugin page, choose the zip file you have downloaded and click Install Now)
- Now, you’ll see the plugin’s settings panel on your admin area :
- First, you need to say that your going to use Rackspace. Go to General Settings (Under Performance menu). Now, scroll down until you see the section called Content Delivery Network. Set the CDN Type to Rackspace Cloud Files. Make sure the Enabled filed is unticked! We don’t want to enable it until we upload the files.
- Now, head over to the CDN menu and scroll down to the Configuration section :
- Now lets fill in the blanks :
Username : Enter your Rackspace username
API key : Enter the key which we copied earlier
Location : Keep it as it is unless you know what you’re doing
Container : Add any name containing only characters. Even without spaces. For example : shoutmeloud
- After you fill the Container, click on Create Container button and it will automatically create a container and fill in the host name filed. If they didn’t get the host name, head over to your Cloud Control Panel > Hosting > Cloud Files and select the created container. Now copy the CDN Url and paste it without http://.
- Don’t add a CNAME because currently Rackspace doesn’t support CNAMEs (But they’ll add it soon).
- Now click on Save Changes
- After that, go to the top of the page and click on export media library to CDN. Also tick other files you need to upload like the wp-includes and hit the relevant upload buttons.
- Sometimes, they won’t upload all of your media library. To fix this, add wp-content/uploads/* to the custom file list, tick and upload custom files.
- Now you’re ready to go! Go to the General Settings and tick the Enabled filed under CDN which we unticked earlier and save. Now, go to the top and click on Clear all Cache.
Now, run some speed tests and see how your page speeds have improved! Got some improvements? Like Rackspace cloud files? Now you can stay with your own host for some more time. If you get any problems during the installation, leave it as a comment!
This is a guest post by Pubudu who blogs at TechHamlet. If you would like to write for ShoutMeLoud check our guest posting guidelines.
Subscribe to Download WordPress Guide Worth $99