Skip to content
Permalink
Browse files
fresh start
  • Loading branch information
jsdelivrbot committed May 7, 2017
0 parents commit 6f47802b173265895558fb52d8e27c05c868ce15
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 0 deletions.
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2017 Dmitriy Akulov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
206 README.md
@@ -0,0 +1,206 @@
[jsDelivr][1] - Open Source CDN
========

Similar to Google Hosted Libraries, jsDelivr is an open source [CDN][6] that allows developers to host their own projects
and anyone to link to our hosted files in their websites.

We offer a stable CDN that can be used in production even on popular websites with huge amounts of traffic.
There are no bandwidth limits or premium features and its completely free to use by anybody.

[jsDelivr – The advanced open source public CDN][11]

[How jsDelivr works (outdated)][4]

[jsDelivr community chat][12]

# Why jsDelivr?


Performance and Uptime Oriented
--------------------

Our public CDN is built with performance and reliability in mind. Everything is optimized and being constantly improved to offer all users maximum speed and uptime. Performance is monitored at all times, and we are always looking into new technologies and providers that may further improve our CDN.

Downtime, timeouts or slow responses are simply unacceptable. The idea is not to simply offer a public CDN, but to offer the best possible experience and a rock-solid product.



Multi-CDN
---------

Unlike the competition, jsDelivr uses multiple CDN providers, resulting in the best possible uptime and performance. We currently use [MaxCDN][7], [CloudFlare][8], and [Fastly][14]. In mainland China we use [Quantil](https://www.quantil.com/) to offer best possible performance.

If a CDN or custom server goes down, websites that use jsDelivr won't have any issues because all traffic will be instantly redirected to remaining operational providers.


Smart Load Balancing
--------------------

jsDelivr uses [Cedexis][10] with real user performance data (also known as RUM) to make its routing decisions. These metrics are gathered from hundreds of websites and are used in our load balancing algorithm to make accurate decisions for serving content.

All providers (CDNs and custom servers) are tested millions times per day by real users from all over the world. Based on this information, jsDelivr knows what provider is the fastest for each user. Each user gets a unique response based on his or her location, ISP, and the providers' uptime in real time.

This system also responds immediately to performance degradation and downtime of providers. If a CDN is under a DDoS attack, and their performance drops in some locations, in matter of seconds the algorithm will pick up the change and start serving a different provider to all affected users.

HTTP2
-----------------

All of our POPs support HTTP2, allowing performant transfers when possible.


China
----------------

jsDelivr has partnered up with multiple Chinese companies to provide fast and reliable file delivery in China mainland and the whole Asian continent. We have servers inside China that improve the delivery speeds and latency significantly. We also have a valid ICP license issued by the Chinese government that protects us from bans and slow downloads.

jsDelivr works perfectly inside China!


# Usage


URL Structure
-------------

Typical usage:
`//cdn.jsdelivr.net/{projectName}/{version}/{file}`
Example: `//cdn.jsdelivr.net/jquery/1.11.0/jquery.min.js`

When you want all the files in that version folder as a single compressed archive:
`//cdn.jsdelivr.net/{projectName}/{version}/{projectName}.zip`

Downloads the three projects' `mainfile` from their latest versions as a single collated file:
`//cdn.jsdelivr.net/g/{projectName},{projectName},{projectName}`

You may specify a specific version or version-branch per file:
`//cdn.jsdelivr.net/g/{projectName}@{version},{projectName}@{versionAlias},{projectName}`

You may also select more than one file from a project (typically for plug-ins that ship with the project):
`//cdn.jsdelivr.net/g/{projectName}@{version}({filepath1}+{filepath2}),{projectName}@{versionAlias},{projectName}`


Version aliasing
-------------

For latest version use:

`//cdn.jsdelivr.net/{projectName}/latest/{file}`

You can also load latest versions per branch:

`//cdn.jsdelivr.net/{projectName}/3.8/{file}` Latest in 3.8 branch

`//cdn.jsdelivr.net/{projectName}/3/{file}` Latest in 3 branch

To automatically load the main file of a project use:

`//cdn.jsdelivr.net/{projectName}/{version}/mainfile`

Depending on the project, jsDelivr will automatically load the main file as configured in `info.ini` with correct MIME HTTP headers. If no `mainfile` parameter was specified, the request will result in 404 error.


Load multiple files with single HTTP request
--------------------------------------------

Load multiple projects using the lastest version of the main file:

`//cdn.jsdelivr.net/g/abaaso,ace,alloyui`

Load version 3.8.15 of the main file for abaaso and the latest version of the main file for the other projects:

`//cdn.jsdelivr.net/g/[email protected],ace,alloyui`

Load the latest version of the main file for all files and for abaaso loads version branch 3.8 (e.g. version 3.8.16):

`//cdn.jsdelivr.net/g/[email protected],ace,alloyui`


To combine multiple files enter the relative paths to all files you want to load inside brackets () separated by a plus + symbol. Brackets can be encoded as %28 and %29 without issues.

Load multiple files from multiple projects:

`//cdn.jsdelivr.net/g/[email protected],[email protected](angular.min.js+angular-resource.min.js+angular-animate.min.js+angular-cookies.min.js+angular-route.min.js+angular-sanitize.min.js)`

As always it supports version aliasing and latest versions:

`//cdn.jsdelivr.net/g/jquery,[email protected](angular.min.js+angular-resource.min.js+angular-animate.min.js+angular-cookies.min.js+angular-route.min.js+angular-sanitize.min.js)`

`//cdn.jsdelivr.net/g/jquery,angularjs(angular.min.js+angular-resource.min.js+angular-animate.min.js+angular-cookies.min.js+angular-route.min.js+angular-sanitize.min.js)`

Now if all files in the combination have a `.css` extension then the server will automatically respond with `Content-Type: text/css` header. In all other cases the server responds with `Content-Type: application/javascript` header.

`//cdn.jsdelivr.net/g/[email protected](angular-ui.min.css),[email protected]`


The first 3-4 requests will be slower, as they are not yet cached. Afterwards, these dynamic files get cached and become static files (same as all others).


Custom CDN Hosting
---

We can work together and setup a custom configuration for your project. This way, you can have full control over your files and the ability to utilize the full power of jsDelivr.

This kind of custom hosting can be suitable for:

* Binary hosting. Windows executable files and zips.
* Frequently updated files.
* Projects that can't follow jsDelivr file structure.
* Some other use that will blow all of our minds.

Simply send an email to [email protected] with a request for more information.

Current OSS projects using custom configs:

* [webjars](http://www.webjars.org/)
* webpack [webpackbin](https://www.webpackbin.com/) and [codesandbox](https://codesandbox.io/)

Contribute Performance Data
---

**jsDelivr** uses real user performance data (also known as RUM) to make its routing decisions. This data is gathered from hundreds of websites and is used in our load balancing algorithm to make accurate decisions based on real time performance metrics.

This is why we offer the ability to all users to help us out. This data is very important and we encourage all users to participate.

All you have to do is include the following JavaScript code in your website before `</body>`.
This code is then executed each time a user visits your website. It uses their browser to test the latency to our CDN providers and gather performance and availability metrics.

These benchmarks are completely transparent to the user and do not impact on browsing in any way. We store the following information:

* Performance metrics to each of our providers.
* Availability metrics to each of our providers.
* Browser’s User-Agent
* First three octets of the user’s IP address

Our JS code is executed with a 2 second delay and tests all of our providers unless interrupted. This testing does not impact on your website performance or user browsing experience.

```html
<script>
(function(a,b,c,d,e){function f(){var a=b.createElement("script");a.async=!0;
a.src="//radar.cedexis.com/1/11475/radar.js";b.body.appendChild(a)}/\bMSIE 6/i
.test(a.navigator.userAgent)||(a[c]?a[c](e,f,!1):a[d]&&a[d]("on"+e,f))})
(window,document,"addEventListener","attachEvent","load");
</script>
```

Alternatively you can also include it in a /g/ combined URL. Simply add `jsdelivr-rum` at the end to include our javascript. For example:

`http://cdn.jsdelivr.net/g/[email protected],jsdelivr-rum`


[Privacy Policy for Data Contribution](http://www.cedexis.com/legal/privacy.html)


[1]: http://www.jsdelivr.com
[2]: http://cdnjs.site/domain/t92YuIWdoRXan9yL6MHc0/jimaek/jsdelivr/blob/master/files/abaaso/info.ini
[3]: http://refresh-sf.com/yui/
[4]: http://blog.maxcdn.com/load-balancing-multiple-cdns-jsdelivr-works/
[5]: http://www.cdnperf.com/
[6]: http://en.wikipedia.org/wiki/Content_delivery_network
[7]: http://tracking.maxcdn.com/c/47243/36539/378
[8]: http://www.cloudflare.com/
[9]: http://cdnjs.site/domain/t92YuIWdoRXan9yL6MHc0/jsdelivr/jsdelivr/fork
[10]: http://www.cedexis.com/
[11]: https://hacks.mozilla.org/2014/03/jsdelivr-the-advanced-open-source-public-cdn/
[12]: https://gitter.im/jsdelivr/jsdelivr
[13]: http://cdnjs.site/domain/t92YuIWdoRXan9yL6MHc0/jsdelivr/libgrabber#add-updatejson-schema
[14]: https://www.fastly.com/
@@ -0,0 +1,102 @@
# jsdelivr-backend

http://beta.jsdelivr.net/

## npm proxy

Load any project hosted on npm:

```
/npm/[email protected]/file
```

Load exact version:

```
/npm/[email protected]/dist/jquery.min.js
```

Use a version range instead of an exact version:

```
/npm/[email protected]/dist/jquery.min.js
/npm/[email protected]/dist/jquery.min.js
```

Not recommended for production usage - load by tag:

```
/npm/[email protected]/dist/jquery.min.js
```

Not recommended for production usage - omit the version completely or use "latest" to load the latest one:

```
/npm/[email protected]/dist/jquery.min.js
/npm/jquery/dist/jquery.min.js
```

Add ".min" to any JS/CSS file to get a minified version - if one doesn't exist, we'll generate it for you. All generated files come with source maps and can be easily used during development:

```
/npm/[email protected]/github-markdown.min.css
```

Omit the file path to get the browser bundle (if available) or the main module:

```
/npm/[email protected]
/npm/[email protected]
/npm/jquery
```

## GitHub proxy

Load any release from GitHub:

```
/gh/user/[email protected]/file
```

Load exact version:

```
/gh/jquery/[email protected]/dist/jquery.min.js
```

Use a version range instead of a exact version:

```
/gh/jquery/[email protected]/dist/jquery.min.js
/gh/jquery/[email protected]/dist/jquery.min.js
```

Not recommended for production usage - omit the version completely or use "latest" to load the latest one:

```
/gh/jquery/[email protected]/dist/jquery.min.js
/gh/jquery/jquery/dist/jquery.min.js
```

Add ".min" to any JS/CSS file to get a minified version - if one doesn't exist, we'll generate it for you. All generated files come with source maps and can be easily used during development:

```
/gh/sindresorhus/[email protected]/github-markdown.min.css
```

## Combine

Load multiple files with a single HTTP request:

```
/combine/url1,url2,url3
```

All features that work for individual files (version ranges, minification, main modules) work here as well. All combined files come with source maps and can be easily used during development.

Examples:

```
/g2/npm/[email protected]/dist/jquery.min.js,npm/[email protected]/dist/js/bootstrap.min.js
/g2/gh/twbs/[email protected]/dist/css/bootstrap.min.css,gh/twbs/[email protected]/dist/css/bootstrap-theme.min.css
```

Large diffs are not rendered by default.

0 comments on commit 6f47802

Please sign in to comment.