官术网_书友最值得收藏!

Optimizing HTTP server responses with GZIP compression

GZIP compression means sending the response to the client from the server in a .gzip format rather than sending a plain response and it’s always a good practice to send compressed responses if a client/browser supports it.

By sending a compressed response we save network bandwidth and download time eventually rendering the page faster. What happens in GZIP compression is the browser sends a request header telling the server it accepts compressed content (.gzip and .deflate) and if the server has the capability to send the response in compressed form then sends it. If the server supports compression then it sets Content-Encoding: gzip as a response header, otherwise it sends a plain response back to the client, which clearly means asking for a compressed response is only a request by the browser and not a demand. We will be using Gorilla’s handlers package to implement it in this recipe.

主站蜘蛛池模板: 庆阳市| 读书| 遵义市| 比如县| 奉化市| 比如县| 古蔺县| 奇台县| 阳信县| 酉阳| 繁峙县| 哈尔滨市| 青神县| 定州市| 汶上县| 新源县| 临沧市| 阿图什市| 林口县| 宿松县| 红安县| 民和| 南安市| 玉环县| 崇仁县| 同江市| 乌鲁木齐县| 历史| 开平市| 桦川县| 民乐县| 怀柔区| 收藏| 安塞县| 岱山县| 正镶白旗| 桂林市| 舒城县| 新乐市| 柳江县| 昌平区|