Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create your own CDN? Is it just creating a subdomain?

Tags:

cdn

I was wondering if it is possible to create my own CDN on my server through plesk alone?
I mean would creating an extra subdomain like cdn.mywebsite.com be sufficient?
And should I create a cdn subdomain for each website I create or should I create a subdomain with server space and upload all images?

like image 950
alex Avatar asked Sep 13 '12 08:09

alex


People also ask

What is a CDN subdomain?

Enabling CDN using your own subdomain keeps the service proprietary to you and points SEO values of the CDN based resources to your root domain — yoursite.com instead of cdn.com. This approach maintains or even increases your main site's authority scores. This in turn boosts your SEO rankings.

What is the difference between subdomain and custom domain?

The subdomain option allows you to choose a subdomain of totalwebsiteprotection.com (mycompany.totalwebsiteprotection.com). No extra setup is required! 2. For even more control, the custom domain option allows you to use any domain you like (backups.mycompany.com).

Does a subdomain have its own cPanel?

The answer is YES, you can have a separate cPanel account for your subdomain. Normally, you can create your subdomains in cPanel->Subdomains->Create a Subdomain. See our article on How to create/delete subdomains in cPanel.

Can I create a new website with a subdomain?

Instead of restructuring or redesigning your existing website, you can use a subdomain to create an e-commerce store. That will give you the freedom to create a whole new webpage, where you can sell your products or service and cater to your customers without disrupting the main site.


1 Answers

The main point of a Content Distribution Network (CDN) is to put the content as close to the end-user as possible, thereby reducing the Distance component of the Round Trip Time (RTT) and speeding up the request. Simply serving static content from a sub-domain isn't really the same as using a CDN.

The advantages of serving content from such a sub-domain, however, are that

  1. The sub-domain can be a cookie-less domain

    If you use your cookies correctly (ie. don't have any *.mydomain.com cookies), you can dramatically reduce the size (ie. number of packets sent) of the HTTP request, which would save on bandwidth and speed up requests significantly if you use cookies heavily on the main site.

  2. The page can benefit from a more simultaneous requests being made by the browser

    Most browsers will make simultaneous requests for page assets, like images, fonts, CSS, etc. The catch is that most browsers will only allow a limited number of open requests to a particular domain (somewhere around 5 I think). By spreading your assets across multiple sub-domains, you "trick" the browser, and allow more parallel requests, since the limit applies to each sub-domain.

So, yes, you could set this up by just making a sub-domain, but you also have to make sure the cookies you are using don't get sent to requests for that sub-domain as well.

like image 79
cdeszaq Avatar answered Nov 14 '22 01:11

cdeszaq