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

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.

主站蜘蛛池模板: 墨脱县| 天等县| 榆社县| 满城县| 宁津县| 肇庆市| 昌吉市| 涞源县| 兴隆县| 通江县| 三江| 阿克| 阳江市| 铜川市| 正安县| 大洼县| 屏南县| 云霄县| 龙口市| 延庆县| 外汇| 淳化县| 眉山市| 政和县| 二连浩特市| 汨罗市| 神池县| 广元市| 嘉禾县| 藁城市| 辽源市| 山阴县| 浦县| 肇州县| 盐池县| 邳州市| 融水| 原阳县| 遵义市| 积石山| 淄博市|