roh355/nanocache ? reverse-engineered prompt

Reverse engineered prompt

Build me a small in memory cache server in C++ that speaks the Redis style protocol over a TCP connection. I want to be able to start it, connect with a simple client, and send basic commands like setting a key, getting a key, deleting a key, and maybe checking if a key exists. It should handle simple text requests and return proper responses so it feels like a lightweight cache service.

Please keep the code clean and easy to follow, with the cache logic separated from the network server and the request parsing. If it makes sense, add a simple snapshot or persistence step so the cache can be saved and restored. Make sure the server can deal with multiple commands in a row without crashing, and add a few examples or comments showing how to test it from the command line. If you need to check current protocol details online, go ahead and do that.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab