Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we create our own CDN links?

Suppose we have two files: style.css and stylejs.js.

Is there a way we can create a CDN link for our files so that others can use it by linking the CDN link just like we do for bootstrap and angular?

If yes, can someone tell me how to achieve that?

like image 772
BizDev Avatar asked Aug 28 '17 12:08

BizDev


2 Answers

If you are already using those files on your own website you can easily give links to those files like http://www.yoursite.com/path/to/your/file/style.js.

If you want to continue serving different versions you can achieve that by adding version numbers to your files like style.1.2.3.js or keeping them in separate directories like /v1.2/style.js.

The other option is to use some sort of CDN Hosting service like Cloudflare. You can find more services like this with a quick google search.

like image 186
bennygenel Avatar answered Sep 23 '22 15:09

bennygenel


Just put these files on any host with clear URL, something like cdn.myhost.com/style.css cdn.myhost.com/js.js

then anyone can link them to their code.

like image 23
Yamen Nassif Avatar answered Sep 22 '22 15:09

Yamen Nassif