peer-cdn

peer-cdn

  • Docs
  • Help
  • GitHub
Project Logo

peer-cdnLightweight library providing peer to peer CDN functionality


self.importScripts("https://github.com/vardius/peer-cdn/blob/v1.0.5-beta/dist/index.js");

const {CachePlugin, DelegatePlugin, NetworkPlugin, strategies: { ordered }} = PeerCDN;

const cachePlugin = new CachePlugin({ version: 1 });
const delegatePlugin = new DelegatePlugin({ timeoutAfter: 5000 });
const networkPlugin = new NetworkPlugin();

const cdn = new PeerCDN();

// select asset to be loaded via peer cdn
cdn.GET("/css/main.css", ordered,
    cachePlugin.getMiddleware,
    delegatePlugin.getMiddleware,
    networkPlugin.getMiddleware
);

cdn.register();
Documentation
Help
GitHub

What and Why ?

PeerCDN is a lightweight library providing peer to peer CDN functionality. Main goal of this project is to reduce the cost of assets transfer server <-> user using WebRTC for caching and bidirectional assets transfer between connected users.

peer-cdn
Docs
Documentation
Community
Support
More
rafallorenz.comGitHubStar
Copyright © 2022 Rafał Lorenz