Green Clook

How to make Magento 1.9 faster by integrating CloudFlare

Magento Guides

Integrating a Content Delivery Network (CDN) with Magento 1.9 is one of the easiest ways to make your Magento store faster.

By doing so, you will ensure you are serving your static files i.e. product images, JavaScript and CSS from a server closest to your shoppers. This will result in faster Magento page load speeds and as an added bonus, a reduction in load on your server.

The following guide will detail how to make Magento 1.9 faster by integrating CloudFlare. The steps include the use of cPanel, though you can perform these particular steps using an alternative admin panel or via the command line

Did you know…

At Clook, one of our specialisms is providing Magento optimised hosting which is significantly faster than a standard install. If you’d like to find out more please get in touch with us.

Create a CloudFlare account

If you don’t have a CloudFlare account, create one and add a domain using this tutorial.

Create a subdomain

Using cPanel, create a subdomain for your CDN content and point it to your Magento install directory. Here my install is in public_html/magento.

You can call the subdomain anything you like but we recommend something similar to cdn for ease of recognition.


Create a CNAME record in CloudFlare’s DNS settings

Follow this guide to add a CNAME record in your CloudFlare dashboard, though instead of using “blog” use “cdn” or whatever subdomain you created in step 2, as below.

make Magento 1.9 faster by integrating CloudFlare

Review CloudFlare’s DNS settings

Check that the only record that has its traffic routed through CloudFlare’s servers is the one you created in step 3.

In the image below you can see that only the CNAME record cdn is passing through CloudFlare’s network, as indicated by the orange cloud.

If there are any other records that are passing through CloudFlare’s network, i.e. those that have an orange cloud, click on them and ensure they are grey and therefore no longer being passed through CloudFlare’s network.



Login to your Magento admin and navigate to System > Configuration



Click on the Web link under the General tab in the left hand menu.



Edit Base Skin URL, Base Media URL and Base JavaScript URL under the “Unsecure” tab so that it references your CDN subdomain path that you created in step 2.

i.e. enter as below but swap for the subdomain you created in step 2

If your site also uses https, be sure to duplicate under the “Secure” tab



Clear your Magento cache by navigating to System > Cache Management > Flush Magento Cache

Your Magento 1.9 store’s static content should now be being served by CloudFlare and you should notice a performance improvement.

About The Author

Will's our technical sales guy from the hills of Rossendale. In his spare time he can be found designing and building websites, or doing a spot of DIY!

Connect on Linkedin

Clook Logo

Get regular tips, tricks and updates!

Signup today for our awesome newsletter and recieve monthly emails with all sorts of helpful articles on hosting and web development.