All Projects → nytimes → Gziphandler

nytimes / Gziphandler

Licence: apache-2.0
Go middleware to gzip HTTP responses

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gziphandler

Aspnetcore Request Decompression
HTTP request decompression middleware for ASP.NET Core
Stars: ✭ 51 (-92.61%)
Mutual labels:  middleware, gzip
Django Compression Middleware
Django middleware to compress responses using several algorithms.
Stars: ✭ 23 (-96.67%)
Mutual labels:  middleware, gzip
Gzip
💾 Golang gzip middleware for Gin and net/http | Golang gzip中间件,支持Gin和net/http,开箱即用同时可定制
Stars: ✭ 113 (-83.62%)
Mutual labels:  middleware, gzip
Connect Gzip Static
connect middleware for statically compressed files
Stars: ✭ 39 (-94.35%)
Mutual labels:  middleware, gzip
Compression
Node.js compression middleware
Stars: ✭ 2,506 (+263.19%)
Mutual labels:  middleware, gzip
Redux Saga
An alternative side effect model for Redux apps
Stars: ✭ 21,975 (+3084.78%)
Mutual labels:  middleware
Soapcore
SOAP extension for ASP.NET Core
Stars: ✭ 590 (-14.49%)
Mutual labels:  middleware
Redux Ecosystem Links
A categorized list of Redux-related addons, libraries, and utilities
Stars: ✭ 5,076 (+635.65%)
Mutual labels:  middleware
Swagger Express Middleware
Swagger 2.0 middlware and mocks for Express.js
Stars: ✭ 543 (-21.3%)
Mutual labels:  middleware
Psr7 Middlewares
[DEPRECATED] Collection of PSR-7 middlewares
Stars: ✭ 666 (-3.48%)
Mutual labels:  middleware
Csrf
gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services 🔒
Stars: ✭ 631 (-8.55%)
Mutual labels:  middleware
Netdiscovery
NetDiscovery 是一款基于 Vert.x、RxJava 2 等框架实现的通用爬虫框架/中间件。
Stars: ✭ 573 (-16.96%)
Mutual labels:  middleware
Underconstruction
This Laravel 8 package makes it possible for you to set your website in "Under Construction" mode. Only users with the correct 4 (or more) digit code can access your site. 🔥 💥 🔥
Stars: ✭ 549 (-20.43%)
Mutual labels:  middleware
Koa Helmet
Important security headers for koa
Stars: ✭ 595 (-13.77%)
Mutual labels:  middleware
Kraken Js
An express-based Node.js web application bootstrapping module.
Stars: ✭ 4,938 (+615.65%)
Mutual labels:  middleware
Amethyst
Amethyst is a Rails inspired web-framework for Crystal language
Stars: ✭ 643 (-6.81%)
Mutual labels:  middleware
Gear
A lightweight, composable and high performance web service framework for Go.
Stars: ✭ 544 (-21.16%)
Mutual labels:  middleware
Alosaur
Alosaur - Deno web framework with many decorators
Stars: ✭ 559 (-18.99%)
Mutual labels:  middleware
Agendash
Agenda Dashboard
Stars: ✭ 620 (-10.14%)
Mutual labels:  middleware
Cors
Node.js CORS middleware
Stars: ✭ 5,252 (+661.16%)
Mutual labels:  middleware

Gzip Handler

This is a tiny Go package which wraps HTTP handlers to transparently gzip the response body, for clients which support it. Although it's usually simpler to leave that to a reverse proxy (like nginx or Varnish), this package is useful when that's undesirable.

Install

go get -u github.com/NYTimes/gziphandler

Usage

Call GzipHandler with any handler (an object which implements the http.Handler interface), and it'll return a new handler which gzips the response. For example:

package main

import (
	"io"
	"net/http"
	"github.com/NYTimes/gziphandler"
)

func main() {
	withoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "text/plain")
		io.WriteString(w, "Hello, World")
	})

	withGz := gziphandler.GzipHandler(withoutGz)

	http.Handle("/", withGz)
	http.ListenAndServe("0.0.0.0:8000", nil)
}

Documentation

The docs can be found at godoc.org, as usual.

License

Apache 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].