Websites | Photography | Video Editing | 3D Animations

From the Blog

Jun
16

How to manually setup Dropbox CDN to hosted WordPress site

Posted by Paul Costan on June 16th, 2011 at 7:12 pm

There are a few ways to optimise your hosted WordPress sites, for example using ‘Quick Cache’ or ‘Mimify’ plugins and many more which will help increase your site performance.

But how about your images? Your WordPress site images can slow down your site if you have lots stored on hosted server. Well I have come up with an quick and easy solution using Dropbox as your CDN. Serving your ‘uploads’ folder from Dropbox ‘Public’ folder. This way helping reduce your upload bandwidth BIG time!

20110702-235933.jpg

This is how:

1. Install Dropbox app on your web server, it does not matter which setup you have Linux, windows etc. But you will get the idea what we’re doing here.

2. Next Cut or Move ‘uploads’ folder (/wp-content/uploads) to your Dropbox ‘Public’ folder (/Public/website-name/uploads)

3.Here is the clever bit… Create a ‘symlink’ from your (/Public/website-name/uploads) to your WordPress (/wp-content/uploads)

Linux command line Example:

$ cd /var/www/html/your-wordpress-folder/wp-content/

$ ln -s /Dropbox/Public/website-name/uploads uploads

For Windows you will need to install ‘Link Shell Extension‘. Once installed, creating a symlink is pretty straight forward.

4. Next go to your Dropbox account online and navigate to your ‘Public’ folder and highlight any file. On the right hand side there is a small downward arrow. Click on it and select ‘copy public Link’

20110616-202033.jpg

5. Now login in to your WordPress admin and go to ‘Settings’ > ‘Media’ and scroll down to ‘Uploads Files’.

20110616-204358.jpg

Now paste your dropbox public link to ‘Full URL path to files’ box field, with the right path… for example:

‘http://dl.dropbox.com/u/9721300/website-name/uploads’

6. And finally hit save and you’re done. You may need to clear your site cache and eventually all image paths should point Dropbox CDN. From now on creating a new post, all images will sync and served from Dropbox.

Enjoy! I hope this has helped speed up your site.

  • Julian

    Thank you. I was looking for a similar solution. I think it would be great if you can add support to synchronize other folder that is not just uploads, for example to implement a kind of download manager for WP that instead of picking the files from uploads folder you can use any other folder. This will be great for sites like http://fppt.com where we publish free templates for download. I’d like to use it.

    On the other side, I’d like to share this other plugin that you may find useful. It is for drag and drop uploads (without even click on the upload button), just throw your files in the green box and voilá.

    http://wordpress.org/extend/plugins/magn-html5-drag-and-drop-media-uploader/

  • Thanks! Your information helped me a lot in speeding our web site http://www.smiletemplates.com. I am totally happy with the result!