Skip to content

losthread/nimbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nimbus

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.

Installation

git clone https://github.com/losthread/nimbus.git
cd nimbus
pip install .

Usage

Run the server in a terminal and send curl requests from another or through a browser

nimbus --port <port_number> --origin <request_url>

Options

  • -p, --port - Port to run proxy on (required)
  • -o, --origin - Origin server URL (required)
  • -c, --clear-cache - Clear cache and exit

Example

Start the proxy cache server:

nimbus --port 3000 --origin https://jsonplaceholder.typicode.com
nimbus --port 3000 --clear-cache

Then 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/2

The cache stores responses in memory with LRU eviction. When full (10 entries), least recently used entries are removed.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

MIT

Project Reference

https://roadmap.sh/projects/caching-server

About

A proxy cache server built using FastAPI with a custom LRU cache in c++

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages