{"id":23181148,"url":"https://github.com/joeshaw/httpgzip","last_synced_at":"2025-09-01T17:43:12.005Z","repository":{"id":18899292,"uuid":"22117506","full_name":"joeshaw/httpgzip","owner":"joeshaw","description":"A Go package that provides an http.Handler wrapper that transparently gzips the response payload.","archived":false,"fork":false,"pushed_at":"2015-08-12T15:39:11.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T11:15:01.184Z","etag":null,"topics":["golang","gzip","http"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeshaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-22T19:22:06.000Z","updated_at":"2015-08-12T15:39:11.000Z","dependencies_parsed_at":"2022-07-16T17:00:29.772Z","dependency_job_id":null,"html_url":"https://github.com/joeshaw/httpgzip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fhttpgzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fhttpgzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fhttpgzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fhttpgzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeshaw","download_url":"https://codeload.github.com/joeshaw/httpgzip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280268,"owners_count":20912967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","gzip","http"],"created_at":"2024-12-18T08:14:42.855Z","updated_at":"2025-04-05T03:14:05.826Z","avatar_url":"https://github.com/joeshaw.png","language":"Go","readme":"# httpgzip #\n\n`httpgzip` is a Go package that provides an `http.Handle` wrapper that\ntransparently compresses the response payload with gzip if the\n`Accept-Encoding: gzip` request header is provided.  It sets the\n`Vary: Accept-Encoding` and `Content-Encoding: gzip` response headers.\n\n## API ##\n\n```go\nmux := http.NewServeMux()\nmux.Handle(\"/\", IndexHandler)\nmux.Handle(\"/login\", LoginHandler)\n\nhttp.ListenAndServe(\":8000\", httpgzip.Handler(mux))\n```\n\nThat's it.  But it's also\n[on godoc](http://godoc.org/github.com/joeshaw/httpgzip).\n\nWithout gzip:\n\n```\n$ curl -v http://localhost:8080/\n\n\u003e GET / HTTP/1.1\n\u003e User-Agent: curl/7.30.0\n\u003e Host: localhost:8000\n\u003e Accept: */*\n\u003e\n\u003c HTTP/1.1 200 OK\n\u003c Content-Type: text/plain; charset=utf-8\n\u003c Date: Tue, 22 Jul 2014 19:16:20 GMT\n\u003c Content-Length: 446\n\u003c\nLorem ipsum dolor sit amet, consectetur adipisicing\nelit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\nlaboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor\nin reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\npariatur. Excepteur sint occaecat cupidatat non proident, sunt in\nculpa qui officia deserunt mollit anim id est laborum.\n```\n\nWith gzip:\n```\n$ curl --compress -v http://localhost:8080/\n\n\u003e GET / HTTP/1.1\n\u003e User-Agent: curl/7.30.0\n\u003e Host: localhost:8000\n\u003e Accept: */*\n\u003e Accept-Encoding: deflate, gzip\n\u003e\n\u003c HTTP/1.1 200 OK\n\u003c Content-Encoding: gzip\n\u003c Content-Type: text/plain; charset=utf-8\n\u003c Vary: Accept-Encoding\n\u003c Date: Tue, 22 Jul 2014 19:17:41 GMT\n\u003c Content-Length: 292\n\u003c\nLorem ipsum dolor sit amet, consectetur adipisicing\nelit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\nlaboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor\nin reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\npariatur. Excepteur sint occaecat cupidatat non proident, sunt in\nculpa qui officia deserunt mollit anim id est laborum.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeshaw%2Fhttpgzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeshaw%2Fhttpgzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeshaw%2Fhttpgzip/lists"}