-
Notifications
You must be signed in to change notification settings - Fork 6
joaodasilva/go-gzip-file-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
net.http.handler.gzip: a FileServer that serves gzipped content. Usage: import "net/http/handler/gzip" base := "/path/to/website/static/files" http.Handle("/static", http.StripPrefix("/static", gzip.FileServer(http.Dir(base)))) Run the example: # (checkout) # export GOPATH=`pwd` # go install net/http/handler/gzip/example # ./bin/example Usage of http.FileServer can be replaced with gzip.FileServer. A request for <file> serves <file>.gz instead if its modification time is not before the original file's, or if the original does not exist. Serves the original if the request doesn't support the "gzip" encoding. index.html can also be gzipped as a default for directories (index.html.gz).
About
A net.http.Handler similar to FileServer that serves gzipped content
Resources
Stars
Watchers
Forks
Releases
No releases published