About Application: IF user makes back to back api call within 5 seconds for a particular user Id the response will not be queried from database rather from cache memory
brew install redis
brew services start redis
./gradlew build
./gradlew bootrun
-
curl -X POST \ 'http://localhost:8081/adduser' \ --header 'Accept: */*' \ --header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \ --header 'Content-Type: application/json' \ --data-raw '{ "name" : "Sambit" }'
-
This will create and save user "Sambit" to the database and return the userid as response
http://localhost:8081/getbyid/1
: It will return user details for user id 1- Response for back to back api call (<5 seconds>) for same user id will be returned from cache memory.