How to Use Dropbox as a CDN for WordPress Static Files

Dropbox is a great online tool. You can store your files on the cloud and you can access it from anywhere like your phone, desktop, laptop at different places. It is really simple and Dropbox has an app for every platform. If you are not a member of Dropbox, then you should join it immediately.

Dropbox can also be used for different purposes. One of those uses which I found really helpful was the ability to use Dropbox as a CDN (Content Delivery Network) for your website. That is right. You can use Dropbox to host your static files publicly and then serve those files from your website. This can decrease the load on your website and possibly improve the speed and performance of your site.

You should have a public directory in Dropbox and that is where we will be storing all the static files of your website. If you do not have a public directory on Dropbox then you can have it enabled.

Today, I am going to share how I managed to use Dropbox as a cloud static file server for my WordPress Blog:

1) Create a directory called cdn and make sure you place it in your public Dropbox folder.

CDN Folder Dropbox

2) Upload directories “wp-content” and “wp-includes” into this cdn folder. You can skip out the php files. Maintain the same directory structure.

Inside CDN Directory

3) In your website, create a sub-domain called cdn.yoursite.com.

4) In the root folder of your website create a .htaccess file and create a redirect such as requests made to it will redirect to your dropbox cdn folder.

Redirect 301 / http://dl.dropbox.com/u/<userid>/cdn/

5) Install WordPress Super Cache plugin and activate it.

6) Go to Settings > WP Super Cache and then click on the CDN tab of the WP Super Cache settings

Wordpress Super Cache Settings for CDN

7) Enter the subdomain you created in step 3 which is cdn.yoursite.com

8) Save the settings and you are done. Now the files will be served from dropbox instead of your WordPress hosting website.

Remember to always update the content of your dropbox cdn wp-content and wp-includes folders as you update your website. When you upload new media like pictures you will have to update your Dropbox as WordPress does not directly upload to Dropbox. Sometimes when your plugins update, you might have to update the static files at Dropbox. This is not the best convenient method but this works for free.

One Reply to “How to Use Dropbox as a CDN for WordPress Static Files”

  1. Dropbox works well for sync. But, I prefer Binfer when I have to send a huge file to someone. More about serverless file sharing

Comments are closed.