raito-cache - is lightweight caching proxy server. This server intercepts requests, caches responses, and serves them from the cache, improving performance by reducing redundant network calls. It also includes command line interface with command handling functionality.
Important
Node.js 18.x+ version must be installed in your OS.
$ yarn add -g raito-cache
$ raito --port 3000 --password raitopass
Start the server:
Usage: raito --port <port> [options]
Lite caching proxy server
Options:
--port <port> define port on which to start the server
--host <host> define host on which to start the server (default: "localhost")
--ttl <ms> define time to live for the cache record in ms
-pass, --password <password> define a password for the server to prevent non authorized connections
-v, --version output the version number
-h, --help display help for command
App commands:
status
- check server statusstop
- stop the server without exiting.start
- start the serverexit
- stop the server and exit the processclear-cache
- deletes all recordsttl ms
- time to live in millisecondsget
- get cache.get *
- get all recordsget key
- get cache by keyget HTTP_METHOD
- get all cached responses from HTTP_METHOD requests. Example:get POST
get :ROUTE
- get all cached responses from the specific route. Example:get :/tasks/2
get HTTP_METHOD:ROUTE
- get a specific cached response
set key data ttl
- create a new record with key and data. ttl - time to live for record (optional)help
- get all commands
- Pull docker image:
$ docker pull stbestich/raito-cache:latest_amd64
- Run it
$ docker run -e HOST=<host> -e PASSWORD=<password> -p <port>:9180 -it stbestich/raito-cache
services:
raito-cache:
image: stbestich/raito-cache:latest
ports:
- "${PORT:-9180}:${PORT:-9180}"
- "${PORT:-9181}:${PORT:-9181" # Define second port if you need http proxy
env_file:
- .env
environment:
NODE_ENV: production
PORT: ${PORT:-9180}
HOST: ${HOST:-0.0.0.0}
TTL: ${TTL}
PASSWORD: ${PASSWORD}
tty: true
stdin_open: true
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Project changes are writen in changelog, see the CHANGELOG.md.
We use SemVer for versioning. For the versions available, see the tags on this repository. For the versions supported, see the SECURITY.md.
This project is licensed under the MIT License - see the LICENSE.md