Cachefly CDN and Joomla

Cachefly is another strong CDN option but it may require some extra configuration to set up a push CDN. Learn if the rewards are worth the effort.

Steven Johnson
by | Posted: July 22, 2011 | Updated: June 7, 2013
Cachefly CDN and Joomla
 

As we continue to tryout new ways to speed up our Joomla sites, it was time to try out a CDN option that could work with any hosting solutions.

We chose Cachefly because to its excellent network, technical support and affordable plans. By affordable I mean they start at $99/month which is still not inexpensive but the level of service and network speed it is an excellent value.

About Cachefly

Cachefly http://cachefly.com is a very popular Content Delivery Network that has affordable plans starting at $99/month.  and as a bonus you can use the same plan for lots of websites.

 

Configuring Joomla to work with Cachefly

There are two steps to get the your images on the Cachefly CDN

1. Setup rsync to automatically copy images to the Cachefly server

2. Configure Joomla to say the images are located on the Cachefly CDN

 

Use rsync to automate the transfer of images to the CDN

Rsync is a server level tool that will automatically transfer the images the cdn.  Once you have rsync working it can be added to the cron tab so that the images are updated at what ever interval you would like.

1. Make sure you have access to the rsync command.  Not all shared host will give you access, here are a couple that will.  

2. Create public key and send it to Cachefly support

3. At the command prompt on your server confirm you can run this command:

4. Once you have rsync set correctly add that tab your servers cron tab.

5. Upload a few test images to your server and confirm that they are being automatically transferred to the Cachefly CDN.  Then delete the images from your server and confirm that they are automatically deleted from the cachefly CDN.

 

Now you have a process to automatically copy and delete images from the CDN.

The next step is to update your site so the images are called from the CDN rather than your main server.

Use Rereplacer to change the location of images

The above step physically moved the images to the CDN now we need to update our Joomla site so that the visitor views the images from the CDN not your Joomla server. Rereplacer is the perfect tool for the job.

Rereplacer will search and replace content on your web pages just before it is displayed. Here is how to install and configure

1. Download and install the rereplacer extension http://www.nonumber.nl/extensions/rereplacer 

2. Setup the rereplacer rules.

More info coming.

Bonus Configuration

Set the expires at Cachefly. 

Why make visitors download the same images over and over.  With Cachefly you can set the expires value so the images do not expire for several months.

Steven Johnson

Steven is a Joomla web developer and worked with Joomla since the Mambo days. He has built websites for startup businesses all the way to for Fortune 500 companies. A graduate of Georgia Tech in Chemical Engineering, he now happily spends his time building websites and reviewing all types of technology.