A HTTP caching proxy built with Node.js.
This project acts as a proxy server between a client and an origin server. It forwards incoming requests, caches responses and saves cached responses on subsequent requests to reduce unnecessary network calls.
- Forward HTTP requests to an origin server
- Cache responses using the request method and URL as the cache key
- Return cached responses with
X-Cache: HIT - Return new responses with
X-Cache: MISS - Preserve response status codes and headers
- Persistent file-based cache (
cache.json) - Clear the cache from the command line
Clone the repository:
git clone https://github.com/sumisera/CachingProxy.git
cd CachingProxyInstall the package locally:
npm install
npm linkStart the proxy:
caching-proxy --port 3000 --origin http://dummyjson.comTo remove all cached responses:
caching-proxy --clear-cache- Node.js
- HTTP module
- Fetch API
- Cache expiration (TTL)