http-server-cache

http-server-cache

#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"
} 
  1. Get cache value with:
http://http-server-cache.eu01.aws.af.cm/?key=isitchristmas&ttl=86400000 HTTP / 1.1 
  1. Delete cache data by key with:
DELETE http://http-server-cache.eu01.aws.af.cm/?key=isitchristmas HTTP / 1.1 
  1. Check results:
{"Error": "cache missed","HasError": true,"ElapsedTime": "6.4 ms"}
or
{"isitchristmas": "NO"}

##Try the demo site :

 
Demo: get cache for isitchristmas key