Api to manage the cache
- Clone or download the project
- Run your MongoDB
- inside the project make:
$ npm install
$ npm start
POST http://localhost:3000/api/cache/{$key}
$key
: name of the key to be created in database, its string will be create randomly in the backend.
GET http://localhost:3000/api/cache
Return list of keys in cache
GET http://localhost:3000/api/cache/{$key}
Return string of key in cache only in case it exits in database, if exits in database and doesn't exits in cache then update it in cache.
DELETE http://localhost:3000/api/cache
Delete all data in cache
DELETE http://localhost:3000/api/cache/{$key}
Delete Specific key in cache
- For this example the cache has a size of 5 keys to save, after it is overcome, the new data will replace to the oldest data in cache.
- Te TTL is of 1 hour.