A simple cache proxy for AWS S3 written in Rust
This project can save your money by two means:
- This project can reduce the requests and traffic to s3 comparing to returning signed url directly to the clients.
- This project can increase fetch speed when you deploy it near to users to get rid of cloudfront fees
Please note that this project does not process authentication, it is intended to be used behind a gateway where authentication is done first.
Authentication is specific to your business and beyond the scope of this project.
Before cargo run
, you need to create a .env
file under root dir of this project that goes:
CACHE_DIR=cached_files
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_DEFAULT_REGION=baz
S3_BUCKET_NAME=qux
CACHE_CAPACITY=1000
or set these values in other config files like docker-compose.yml
.
They are essential for this program to run.
GET /:path
Return a cached file. If it is not cached, pull from s3.
HEAD /:path
Check if a file is cached
dockerize- invalidate interface
a background worker that auto removes files according to configured timeoutuse streamcheck etag checksum