Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iassasin/reqcache
Cache requests to upstream server forever
https://github.com/iassasin/reqcache
http-cache performance-testing proxy proxy-cache
Last synced: 14 days ago
JSON representation
Cache requests to upstream server forever
- Host: GitHub
- URL: https://github.com/iassasin/reqcache
- Owner: iassasin
- License: mit
- Created: 2019-09-19T18:11:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T09:45:45.000Z (over 5 years ago)
- Last Synced: 2024-11-05T20:13:16.140Z (2 months ago)
- Topics: http-cache, performance-testing, proxy, proxy-cache
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reqcache
Simple utility to proxy and cache all requests to upstream server.
Useful when you need to benchmark microservice by self and exclude other services affects# Prepare to use
Just clone the repository and install dependecies:
```
npm install
```# Usage
```
node reqcache port baseUrl [debug]
```Parameters:
- `port` - port to listen on
- `baseUrl` - base url to proxy requests
- `debug` - optional flag for printing debug info# Example
For example, run cached proxy for `http://example.com`, that uses resource `/styles.css`:
```
node reqcache 3030 http://example.com debug
```
Open in browser `http://localhost:3030` and you will see in console something like:
```
Proxying to https://example.com at 0.0.0.0:3030
new request: GET /
response: /: 200
get from cache: GET /
new request: GET /styles.css
response: /styles.css 200
get from cache: GET /styles.css
```Then reload page in browser:
```
get from cache: GET /
get from cache: GET /styles.css
```
Reqcache memorized first response and just return it again with no requests to upstream server.