Skip to content
Yet Another CDN.
JavaScript Shell Dockerfile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cache put placeholder in cache Mar 31, 2019
docs Update design-doc.md Jul 13, 2019
lib
test global stats test pull correct endpoint Jul 10, 2019
.gitignore fix linter and increase test timeout Apr 4, 2019
.travis.yml
Dockerfile
LICENSE Initial commit Feb 14, 2017
README.md moved design doc badge Jul 12, 2019
benchmark.js Display verbose tests Mar 17, 2019
cdn-load-test.sh
config.js istanbul ignore config file May 13, 2019
docker-compose.yml
install.sh
nginx.conf
nodes.json remove double / Jul 10, 2019
package-lock.json Bump koa from 2.7.0 to 2.8.1 Aug 19, 2019
package.json Bump koa from 2.7.0 to 2.8.1 Aug 19, 2019
process.json scaling May 1, 2019
server.js fix typo Jul 10, 2019

README.md

yacdn.org

Yet Another CDN.

Build Status Coverage Status Design Doc License CDN Hits CDN Data Cache Usage

CDN

How to Use

By default the file will be kept in the cache for 24 hours.

https://yacdn.org/serve/<uri>

Need to refresh the object more frequently than 24 hours? You can set maxAge manually:

https://yacdn.org/serve/<uri>?maxAge=[seconds]

Example

https://yacdn.org/serve/http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png

https://yacdn.org/serve/http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png

Proxy / CORS Proxy

Can also be used as an effective proxy / CORS proxy by using the proxy endpoint.

How to Use

https://yacdn.org/proxy/<uri>

Example

https://yacdn.org/proxy/http://meowbaari.com/wp-content/uploads/2016/06/1464933927_cat_acrobat.png

https://yacdn.org/proxy/http://meowbaari.com/wp-content/uploads/2016/06/1464933927_cat_acrobat.png

Technical

Setup

Work in progress. Run as root.

> curl -o - https://raw.githubusercontent.com/ovsoinc/yacdn.org/master/install.sh | bash
> certbot --nginx

Running

> touch blacklist.txt
> node server
yacdn:server Server listening on port 3000... +0ms
yacdn:server serve#205 url: http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png +5s
yacdn:server serve#205 referer: undefined +1ms
yacdn:cache http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png not in cache +0ms
yacdn:cache lock true +0ms
yacdn:server serve#205 size: 0.02 MB +398ms
yacdn:server serve#205 done, took 404ms +5ms
yacdn:server serve#205 effective speed: 0.04 megabits/s +0ms
yacdn:server serve#206 url: http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png +5s
yacdn:server serve#206 referer: undefined +0ms
yacdn:cache http://meowbaari.com/wp-content/uploads/2016/06/1464933654_cat_sleep.png already in cache +5s
yacdn:server serve#206 size: 0.02 MB +2ms
yacdn:server serve#206 done, took 2ms +0ms
yacdn:server serve#206 effective speed: 8.64 megabits/s +0ms

Benchmarking

> node benchmark.js https://speed.hetzner.de/100MB.bin
https://speed.hetzner.de/100MB.bin - took 32958 ms
https://speed.hetzner.de/100MB.bin - took 56222 ms
https://speed.hetzner.de/100MB.bin - took 40457 ms
Took 43212ms on average (min: 32958ms, max: 56222ms)

https://yacdn.org/proxy/https://speed.hetzner.de/100MB.bin - took 21116 ms
https://yacdn.org/proxy/https://speed.hetzner.de/100MB.bin - took 19269 ms
https://yacdn.org/proxy/https://speed.hetzner.de/100MB.bin - took 20951 ms
Took 20445ms on average (min: 19269ms, max: 21116ms)

https://yacdn.org/serve/https://speed.hetzner.de/100MB.bin - took 25699 ms
https://yacdn.org/serve/https://speed.hetzner.de/100MB.bin - took 23810 ms
https://yacdn.org/serve/https://speed.hetzner.de/100MB.bin - took 19544 ms
Took 23018ms on average (min: 19544ms, max: 25699ms)

yacdn proxy is 52.69% faster
yacdn serve is 46.73% faster
You can’t perform that action at this time.