Gat
An HTTP caching server
Features
- Supports http and https protocols
- Configurable limit for the cache - coming soon!
- Automatically deletes the resouce not found on the remote host
- Automatically reclaims the disk space based on LRU - coming soon!
- Saves bandwidth and time
Installation
$ npm i gat -g
Usage
Standalone
$ gat -h Usage: gat [options] [command] Commands: config show config start start gat stop stop gat restart restart gat empty empty cache * unknown command Options: -h, --help output usage information -V, --version output the version number -e, --edit edit config $ gat startinfo: starting gat on port 1947 $ gat config # show config $ gat -e config # edit config
Request
curl -O "http://localhost:1947/?protocol=https&hostname=dl.dropboxusercontent.com&resource=/s/j4ev9qfa3wz34xl/walle_128.png"
Response
HTTP/1.1 200 OKserver: Gat/0.0.9date: Sun, 10 Mar 2013 17:31:27 GMTcontent-type: image/pngcontent-length: 817701connection: keep-alivex-robots-tag: noindex,nofollowaccept-ranges: bytesx-server-response-time: 523x-dropbox-request-id: 7914ee643fdfb67bpragma: publiccache-control: max-age=0
As a node module
var os = ;var fs = ;var path = ;var Gat = Gat; var FILE = "walle.png";var FILE_PATH = path; Gat; var gat = "https" "dl.dropbox.com";gat;