Skip to content

Cache server that complies with the memcached specified protocol.

License

Notifications You must be signed in to change notification settings

stuvrun/cache-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cache-server

Cache server that complies with the memcached specified protocol.

Requirements

Installation

Use the package manager Yarn to install the dependencies.

~$ yarn install

Build Docker image

~$ docker build -f ./Dockerfile . --no-cache -t braren/cache-server:1.0.1

Usage

Run

~$ yarn start

Run Docker image

~$ docker run --name mycache -p 11211:11211 -d braren/cache-server:1.0.1

Test - Jest

~$ yarn test

Test - JMeter

~$ # open file with jmeter
~$ ./jmeter_test_plan.jmx

Examples

Retrieval commands

input

get <key>*\r\n #* means one or more key strings separated by whitespace.
gets <key>*\r\n #* means one or more key strings separated by whitespace.

output

VALUE <key> <flags> <bytes> [<cas unique>]\r\n
<data block>\r\n
END

Storage commands

input

set <key> <flags> <exptime> <bytes> [noreply]\r\n
add <key> <flags> <exptime> <bytes> [noreply]\r\n
replace <key> <flags> <exptime> <bytes> [noreply]\r\n
append <key> <flags> <exptime> <bytes> [noreply]\r\n
prepend <key> <flags> <exptime> <bytes> [noreply]\r\n
cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n

output

STORED\r\n #to indicate success.
NOT_STORED\r\n #to indicate the data was not stored, but not because of an error. This normally means that the condition for an "add" or a "replace" command wasn't met.
EXISTS\r\n #to indicate that the item you are trying to store with a "cas" command has been modified since you last fetched it.
NOT_FOUND\r\n #to indicate that the item you are trying to store with a "cas" command did not exist.

Deletion

input

delete <key> [noreply]\r\n

output

DELETED\r\n #to indicate success or
NOT_FOUND\r\n #to indicate that the item with this key was not found.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Copyright (c) 2020 Brayan Steven Rendón

About

Cache server that complies with the memcached specified protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published