https://github.com/wubingzheng/fcache
lightweight, reliable and high-performance HTTP cache, based on file, suitable for CDN especially.
https://github.com/wubingzheng/fcache
cache cdn http
Last synced: 11 months ago
JSON representation
lightweight, reliable and high-performance HTTP cache, based on file, suitable for CDN especially.
- Host: GitHub
- URL: https://github.com/wubingzheng/fcache
- Owner: WuBingzheng
- License: gpl-2.0
- Created: 2016-06-26T10:52:08.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-05T02:19:46.000Z (over 9 years ago)
- Last Synced: 2025-04-12T09:44:57.622Z (about 1 year ago)
- Topics: cache, cdn, http
- Language: C
- Size: 52.7 KB
- Stars: 12
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## fcache
`fcache` is a lightweight, reliable and high-performance HTTP cache,
based on file, suitable for CDN especially.
`fcache` is a bit like `memcache`, with 2 main difference:
* HTTP protocol, more compatible with HTTP proxy and server;
* based on file, normal file or block device, e.g. /dev/sda1.
Compared to other HTTP caches (e.g. `Squid` and `Varnish`), `fcache`
is much more lightweight and easy to use.
## configuration file
See `fcache.conf.sample`.
Only `device` and `listen` are required.
Use `device` to assign some files for storage. Normal files and block device files
are supported, while block device (raw disk or disk patition) is recommended in
production for better performance.
Use `listen` to assign some services. You can assign multiple services, with
difference configuration and for independent statistics. For example, one for pictures,
one for static files, and one for htmls.
Other commands are optional, and their default values are given in `fcache.conf.sample`.
All the configuration can be updated by reload, without restarting.
## usage
Build:
make # "output/" will be created
After creating a simple configure file, start up:
./fcache [options] # "fcache.pid" will be created
Quit:
echo quit | nc 127.1 5210
Reload configure:
echo reload | nc 127.1 5210
Running status:
echo status | nc 127.1 5210
where `5210` is the default admin port.
## works with Nginx
Because `fcache` does not have the ability to access the origin when request missing,
so we need the WebServer to fetch the item from origin and store it into `fcache`.
If Nginx is the WebServer, a filter module `jstore` is used to store the missing
item by subrequest.
See `nginx-jstore\` for the code and usage.
## OS-machine
GNU/Linux on x86_64
## licence
GPLv2