http-server-cache

http-server-cache

npm install http-server-cache
40 downloads in the last month

http server cache

A nodejs app running a simple http server cache

  • Nodejs = 0.10.16
  • Express.js = 3.x.x
  • Git for deploy

1.Run the server:

node server.js 
  1. Put cache pair key-value with TTL(in ms):

    POST http://http-server-cache.eu01.aws.af.cm/?key=isitchristmas&ttl=86400000 HTTP / 1.1
    User-Agent: none
    Host: http-server-cache.eu01.aws.af.cm
    Content-Length: 23
    {
     "isitchristmas": "NO"
    } 
    
  2. Get cache value with:

    http://http-server-cache.eu01.aws.af.cm/?key=isitchristmas&ttl=86400000 HTTP / 1.1 
    
  3. Delete cache data by key with:

    DELETE http://http-server-cache.eu01.aws.af.cm/?key=isitchristmas HTTP / 1.1 
    
  4. Check results:

    {"Error": "cache missed","HasError": true,"ElapsedTime": "6.4 ms"}
    or
    {"isitchristmas": "NO"}
    

Try the demo site :

 
Demo: get cache for isitchristmas key
npm loves you