What is a CDN (Content Delivery Network) ?
Content Delivery Network are a distributed system of server’s spread across different geographical locations generally across continent’s in order to serve content of a web service locally. For instance you are in Italy and you have an e-commerce site and that operates globally serving customer’s from different countries which are located very far from the server in which your website resides geographically. Now, data can be sent over such long distance but with time taken will be more. In order to avoid that a CDN host’s some part of your content that are static in nature and serves the content for the country nearby it. In this way CDN (Content Delivery Network) works.
CDN are generally required to serve static content’s like png, jpeg, gif images, videos, text files, java-script and style-script files.
CDN are for everyone starting from blog’s to e-commerce and to complex site’s like facebook.
Some of the popular content delivery provider’s include:
- Max CDN
- Rackspace Cloud Server’s
- Media Temple Pro CDN
- and etc.
SUBDOMAIN AS A CDN
- You can also have your own self hosted CDN.
- A subdomain present in the same hosting environment as your site.
- A domain hosted else where can be used a CDN.
How To Set Up Self Hosted Sub domain As A CDN
step1: log into your c-panel of your hosting provider and create a sub domain.
step2: Activate CDN in w3 total cache in wordpress or go for the CDN setting in wp-super cache or the plugin you use for caching. I’d recommend W3 Total Cache for caching in wordpress.
step3: Go to CDN settings in W3 total cache and populate the settings as i’ve done. These are pretty much basic and same for all site’s. Fill them as per your choice. Remember if you use child theme then you ‘ve to also upload parent theme’s file’s to the CDN. First five should be left checked unlike this scrrenshot as basic settings. A i was testing with the settings so the screenshot is a bit different.
step4: Select passive ftp mode and fill in your details. If 127.0.0.1 doesn’t work for you then use ftp.yourdomain.com . password is same as your hosting password. Moreover you can add multiple CNAME’s. Like one for CSS style scripts, one for media attachements… and so on.
Step5: Test and save settings. Now you can upload your static files to your newly created CDN. Simply click on “Importing attachment’s into the media library” first followed by other’s.
That’s all on creating a self hosted subdomain as a CDN. Let me know if you run into any confusions or face any problem in the comment’s below.