https://github.com/haisum/httpcacheserver
A simple HTTP file cache server
https://github.com/haisum/httpcacheserver
cache file-server golang http-proxy
Last synced: about 1 month ago
JSON representation
A simple HTTP file cache server
- Host: GitHub
- URL: https://github.com/haisum/httpcacheserver
- Owner: haisum
- Created: 2017-11-06T07:45:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-07T07:38:37.000Z (over 8 years ago)
- Last Synced: 2025-12-18T22:09:59.740Z (7 months ago)
- Topics: cache, file-server, golang, http-proxy
- Language: Go
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a very simple http cache server for files.
You can run it to speed up frequently accessed files on your local network. I personally use it for caching a maven repository. It has also been tested as yum repository cache server.
Execution is simple, you can put parameters in config.yaml or in environment variables with HCS_ as prefix followed by parameters in config.yaml.
Usage Example
--------------
If you wanted to cache http://mirror.centos.org/centos/ and put suffix as /proxy, you can access http://mirror.centos.org/centos/timestamp.txt on http://localhost:8081/proxy/timestamp.txt. Future requests will be served from cache unless file on remote host is modified.
All cache is saved in directory defined in DATA_DIR parameter. Server doesn't automatically expire any cache, so if you want to delete cache on some criteria like files which are N days old, you can safely write a bash/batch script and put it as cronjob to delete files in cache directory.
Currently it relies on Last-Modified header, and won't work if this header isn't provided.
Building
---------------
`go build -o httpcacheserver main.go`
If you don't have go installed, you can download pre-compiled binaries from releases tab on Github.com
Executing
-------------
####Linux
nohup ./httpcacheserver &
####Windows
httpcacheserver.exe