Giter Site home page Giter Site logo

edge's Introduction

Edge

Edge is a lightweight edge server for a CDN that runs on Node. It has no dependencies (other than Node) is quite simple to use:

 var edge = require('Edge');
 var edge_server = edge.createServer({host: 'nodejs.org'});

This simple configuration will reverse proxy, then cache all responses keyed on the request URL.

Additional options:

 var edge_server = edge.createServer({host: 'nodejs.org', 
                                      port: 80,
                                      pathPrefix: '/docs/v0.4.7/api/assets',
                                      defaultMaxAge: 60*60*48 });

You can also just use directly from the command line (equivalent to above:

 > node lib/edge-server.js nodejs.org 80 /docs/api/v0.4.7/api/assets 172800

Edge supports the following common features:

  • Expires cached assets based on the Expires or Cache-Control headers of the origin request.
  • Correctly uses client request headers to respond with 304 if possible
  • Sets Cache-Control to a default if origin response doesn't have Cache-Control or Expires header
  • Cookieless
  • Simultaneous requests for the same cache missed asset will not result in multiple origin server requests. Each request will listen on the response of one single origin server request.

More: For more info on CDNs, Node, and why I built this see these presentation slides: https://docs.google.com/present/view?id=dggt936r_21gg4kc7f6

Note: This project has not been battle-tested. It is not production-ready.... yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.