Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gotha/blitz-proxy
https://github.com/gotha/blitz-proxy
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gotha/blitz-proxy
- Owner: gotha
- Created: 2024-08-06T04:53:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T19:13:14.000Z (5 months ago)
- Last Synced: 2024-09-20T06:42:29.368Z (4 months ago)
- Language: Go
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blitz Proxy
Caching proxy with configurable storage
# Configure
```
# http port to be used by the proxy
PORT=4001
# http server to proxy
BACKEND=http://example.com:1234
# comma separated list of paths that should not be cached
NO_CACHE_LIST="^/health$,^/user/.*/profile$"
```## Storage
### File storage
If no configuration is provided, the default cache store is in files in the temp folder.
### Dynamodb
If DynamoDB `STORE_TYPE` is set and the table does not exist, it will be created automatically.
```
STORE_TYPE=DYNAMODB
AWS_ENDPOINT=http://localhost:28000
AWS_ACCESS_KEY_ID=local
AWS_SECRET_ACCESS_KEY=local
AWS_DYNAMODB_TABLENAME=test1
AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=5
AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=5
```If you set AWS_DYNAMODB_PROVISIONED_READ_CAPACITY and AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY to 0, this will create DynamoDB table with 'per request' billing mode.
## Usage
### Get latest cache
```sh
curl \
-H "X-Blitz-Cache-Id: uuid1" \
-d '{"hello": "world"}' \
-X POST \
http://blitz/path/uri
```### Make request without cache
```sh
curl \
-H "X-Blitz-Cache-Id: uuid1" \
-H "Cache-Control: no-cache" \
-d '{"hello": "world"}' \
-X POST \
http://blitz/path/uri
```### Invalidate cache for key
```sh
curl http://blitz/__internal/cache/bust/uuid1
```