Skip to content Skip to sidebar Skip to footer

What Does It Mean By "host Bootstrap By Yourself"?

I'm getting starting with bootstrap and followed a website that says There are two ways to start using Bootstrap on your own web site. you can Download Bootstrap from getbootst

Solution 1:

Hosting any css/js file yourself means that you put it on your own website/server. It means people will download it from your website every time they open it up. (unless it's cached locally by the browser, but at least the very first time)

CDN is used so that people already have the files in their cache from any other website they visited using the same CDN. (For example, a google font) This drastically reduces loadtimes for first time visitors, but you do risk delays that are out of your control by loading something from an external website (if it's out, yours won't work properly!)

So it's a speed vs risk thing, basically.

Solution 2:

hosting it yourself means you download the file and put it in the same place as your website on your web-hosting server.

otherwise, you can reference it in your website with a CDN(content deliver network). these networks hold files for you to use. you add a reference to in your website. and you don't have to keep the bootstrap files on your own server.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

^ this is an example of CDN. they'll probably have a server keeping the file bootstrap.min.css, then they get a domain (bootstrapcnd.com), create a sub-domain(maxcdn). and you can request the resource(the bootstrap.min.css file) from it.

Of the 2 options, you can choose which one is the best for YOU.

i'd list out the "goods" and "bads" of both:

  • Availability: Hosting on your own server means, you never have to worry what happens about downtime. as long as you have your own server up(where your website files are placed) your resources will be available too. Whereas, if your vendor resources(jQuery, Bootstrap) come from a CDN, the CDN server being down will affect your visitors too. A GOOD CDN Service however, gives up time up of around 99.9%.
  • Usability: What do you do when you want to update your jQuery or Bootstrap? If you're hosting yourself, you go to the jQuery or Bootstrap website, download the file and put it on your server, then update the reference in your html. With CDN, you just update the version(given that particular CDN has the updated file).
  • Caching: Every unique visitor to your website will download the resources(jQuery, Bootstrap etc) if it's hosted on your server. With CDN, it these files might already be cached on their browser if they visited a website that uses the same CDN as you. resulting in faster loading time for YOUR page.
  • Bandwidth: Let's say you're using a very cheap hosting. and they give you like 100 MB bandwidth every month. but you do get a 30 unique visitors daily. your website page size with jQuery is 100 KB. and your monthly bandwidth usage around, (30*100*30/1000 = ) 90MB. with jQuery(~84KB) on CDN it becomes (16*30*30 /1000 = ) 14.4MB. (Again this is a hypothetical case. i don't think you can find a hosting as bad as 100MB a month, but you get the point).

I'll add up more when i remember them. hope it helps.

Post a Comment for "What Does It Mean By "host Bootstrap By Yourself"?"