Skip to content

A blazing-fast Node.js + TypeScript caching proxy server built to improve performance by serving cached responses instantly. It includes a simple CLI, Docker support, easy cache clearing, and helpful cache status headersβ€”all powered by Express and Node-Cache.

Notifications You must be signed in to change notification settings

xeureka/Caching-Proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Caching Proxy CLI

A super-fast Node.js + TypeScript caching proxy server designed to boost performance by serving cached responses!
It comes with a convenient CLI, Docker support, and easy cache clearing.


✨ Features

  • CLI Tool: Start a caching proxy server that forwards requests to an origin, caches responses in-memory, and returns them for repeated requests.
  • Clear Cache: Easily clear the cache using the CLI.
  • Docker & Docker Compose: Seamless deployment with Docker support.
  • Cache Status Headers:
    • X-Cache: HIT β†’ Served from cache.
    • X-Cache: MISS β†’ Fetched from origin server.
  • Built with: Node.js, Express, TypeScript, and Node-Cache.

πŸ“‚ Project Structure

caching-proxy/
β”œβ”€β”€ bin/
β”‚   └── caching-proxy.ts    # CLI entry point
β”œβ”€β”€ src/
β”‚   └── cache.ts            # Cache utility functions
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

🐳 Running with Docker

Get up and running with Docker in a flash!

1. Build the Docker Image:

docker build -t caching-proxy .

2. Run the Caching Proxy Container:

docker run -it --rm -p 3000:3000 caching-proxy --port 3000 --origin http://dummyjson.com

3. Clear Cache Via Docker:

docker run -it --rm caching-proxy --clear-cache

About

A blazing-fast Node.js + TypeScript caching proxy server built to improve performance by serving cached responses instantly. It includes a simple CLI, Docker support, easy cache clearing, and helpful cache status headersβ€”all powered by Express and Node-Cache.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published