{"id":46064466,"url":"https://github.com/gowww/compress","last_synced_at":"2026-03-01T12:06:06.131Z","repository":{"id":57499498,"uuid":"54775915","full_name":"gowww/compress","owner":"gowww","description":"🔬 A clever gzip compressing handler","archived":false,"fork":false,"pushed_at":"2020-09-11T17:34:41.000Z","size":24,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T06:02:10.450Z","etag":null,"topics":["compress","go","golang","gzip","handler","http","middleware","response"],"latest_commit_sha":null,"homepage":"","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/gowww.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":"2016-03-26T11:23:37.000Z","updated_at":"2025-02-17T15:16:02.000Z","dependencies_parsed_at":"2022-08-28T15:22:20.393Z","dependency_job_id":null,"html_url":"https://github.com/gowww/compress","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gowww/compress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowww%2Fcompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowww%2Fcompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowww%2Fcompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowww%2Fcompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gowww","download_url":"https://codeload.github.com/gowww/compress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowww%2Fcompress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T11:43:06.159Z","status":"ssl_error","status_checked_at":"2026-03-01T11:43:03.887Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compress","go","golang","gzip","handler","http","middleware","response"],"created_at":"2026-03-01T12:06:02.603Z","updated_at":"2026-03-01T12:06:06.120Z","avatar_url":"https://github.com/gowww.png","language":"Go","readme":"# [![gowww](https://avatars.githubusercontent.com/u/18078923?s=20)](https://github.com/gowww) compress [![GoDoc](https://godoc.org/github.com/gowww/compress?status.svg)](https://godoc.org/github.com/gowww/compress) [![Build](https://travis-ci.org/gowww/compress.svg?branch=master)](https://travis-ci.org/gowww/compress) [![Coverage](https://coveralls.io/repos/github/gowww/compress/badge.svg?branch=master)](https://coveralls.io/github/gowww/compress?branch=master) [![Go Report](https://goreportcard.com/badge/github.com/gowww/compress)](https://goreportcard.com/report/github.com/gowww/compress) ![Status Stable](https://img.shields.io/badge/status-stable-brightgreen.svg)\n\nPackage [compress](https://godoc.org/github.com/gowww/compress) provides a clever gzip compressing handler.\n\nIt takes care to not handle small contents, or contents that are already compressed (like JPEG, MPEG or PDF).  \nTrying to gzip them not only wastes CPU but can potentially increase the response size.\n\n## Installing\n\n1. Get package:\n\n\t```Shell\n\tgo get -u github.com/gowww/compress\n\t```\n\n2. Import it in your code:\n\n\t```Go\n\timport \"github.com/gowww/compress\"\n\t```\n\n## Usage\n\nTo wrap an [http.Handler](https://golang.org/pkg/net/http/#Handler), use [Handle](https://godoc.org/github.com/gowww/compress#Handle):\n\n```Go\nmux := http.NewServeMux()\n\nmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprint(w, \"Hello\")\n})\n\nhttp.ListenAndServe(\":8080\", compress.Handle(handler))\n```\n\nTo wrap an [http.HandlerFunc](https://golang.org/pkg/net/http/#HandlerFunc), use [HandleFunc](https://godoc.org/github.com/gowww/compress#HandleFunc):\n\n```Go\nhttp.Handle(\"/\", compress.HandleFunc(func(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprint(w, \"Hello\")\n}))\n\nhttp.ListenAndServe(\":8080\", nil)\n```\n\nAll in all, make sure to include this handler above any other handler that may write the response.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowww%2Fcompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgowww%2Fcompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowww%2Fcompress/lists"}