Nimbus is a simple, caching proxy server implemented in Python with FastAPI. It serves as a basic solution for caching HTTP requests and responses with an LRU cache which is implemented in C++ using a doubly linked list and hashmaps.
git clone https://github.com/losthread/nimbus.git
cd nimbus
pip install .Run the server in a terminal and send curl requests from another or through a browser
nimbus --port <port_number> --origin <request_url>-p, --port- Port to run proxy on (required)-o, --origin- Origin server URL (required)-c, --clear-cache- Clear cache and exit
Start the proxy cache server:
nimbus --port 3000 --origin https://jsonplaceholder.typicode.com
nimbus --port 3000 --clear-cacheThen in another terminal, make requests:
# First request - fetches from origin
curl http://localhost:3000/posts/1
# Second request - returns from cache (instant)
curl http://localhost:3000/posts/1
# Different endpoint - fetches from origin
curl http://localhost:3000/posts/2The cache stores responses in memory with LRU eviction. When full (10 entries), least recently used entries are removed.
Contributions are welcome! Feel free to open issues or submit pull requests.
MIT