{"id":4613,"date":"2022-12-13T17:25:15","date_gmt":"2022-12-13T20:25:15","guid":{"rendered":"http:\/\/wiki3.locaweb.com.br\/?post_type=ht_kb&#038;p=4613"},"modified":"2022-12-27T16:11:24","modified_gmt":"2022-12-27T19:11:24","slug":"como-habilitar-gzip-deflate-hospedagem-de-sites","status":"publish","type":"ht_kb","link":"https:\/\/www.locaweb.com.br\/ajuda\/wiki\/como-habilitar-gzip-deflate-hospedagem-de-sites\/","title":{"rendered":"Como habilitar Gzip Deflate &#8211; Hospedagem de Sites"},"content":{"rendered":"    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\"><b>Informa\u00e7\u00e3o!<\/b><\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tEssa t\u00e9cnica consiste na compacta\u00e7\u00e3o dos arquivos solicitados pelo navegador antes deles serem enviados pelo servidor, faz com que sua aplica\u00e7\u00e3o carregue mais r\u00e1pido tendo em vista que o tamanho dos arquivos trafegados pela rede vai diminuir consideravelmente.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<h6>Conceito<\/h6>\n<ul>\n<li>Imagine que uma p\u00e1gina em seu site utilize o seguinte CSS:<\/li>\n<\/ul>\n<pre> &lt;link rel=\"stylesheet\" href=\"style.css\" type=\"text\/css\"\/&gt;<\/pre>\n<p>Ao habilitar a compacta\u00e7\u00e3o via <strong>Gzip\/deflate<\/strong> o fluxo de requisi\u00e7\u00f5es se dar\u00e1 da seguinte forma:<\/p>\n<ul>\n<li>Navegador requisita o arquivo <strong>style.css<\/strong>;<\/li>\n<li>O servidor encontra o arquivo <strong>style.css<\/strong> e o compacta;<\/li>\n<li>Responde com o arquivo <strong>style.css<\/strong> compactado;<\/li>\n<li>Navegador descompacta o arquivo <strong>style.css<\/strong> e exibe o conte\u00fado requisitado.<\/li>\n<\/ul>\n<p>Para utilizar, basta alocar em seu diret\u00f3rio public_html, no arquivo .htaccess, o seguinte conte\u00fado:<\/p>\n<pre>AddOutputFilterByType DEFLATE text\/plain\r\nAddOutputFilterByType DEFLATE text\/xml\r\nAddOutputFilterByType DEFLATE application\/xhtml+xml\r\nAddOutputFilterByType DEFLATE text\/css\r\nAddOutputFilterByType DEFLATE application\/xml\r\nAddOutputFilterByType DEFLATE image\/svg+xml\r\nAddOutputFilterByType DEFLATE application\/rss+xml\r\nAddOutputFilterByType DEFLATE application\/atom_xml\r\nAddOutputFilterByType DEFLATE application\/x-javascript\r\nAddOutputFilterByType DEFLATE application\/javascript\r\nAddOutputFilterByType DEFLATE application\/x-httpd-php\r\nAddOutputFilterByType DEFLATE application\/x-httpd-fastphp\r\nAddOutputFilterByType DEFLATE application\/x-httpd-eruby\r\nAddOutputFilterByType DEFLATE text\/html\r\nSetOutputFilter DEFLATE\r\nBrowserMatch ^Mozilla\/4 gzip-only-text\/html\r\nBrowserMatch ^Mozilla\/4.0[678] no-gzip\r\nBrowserMatch ^HMSI[E] !no-gzip !gzip-only-text\/html\r\nSetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary<\/pre>\n<ul>\n<li>Ap\u00f3s adicionar o c\u00f3digo, se quiser, \u00e9 poss\u00edvel testar atrav\u00e9s do link <a href=\"http:\/\/www.whatsmyip.org\/http-compression-test\/\">http:\/\/www.whatsmyip.org\/http-compression-test\/<\/a><\/li>\n<\/ul>\n    \t\t<div class=\"hts-messages hts-messages--alert  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\"><strong>Observa\u00e7\u00e3o!<\/strong><\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tLembramos que o c\u00f3digo informado acima \u00e9 uma sugest\u00e3o de como a compacta\u00e7\u00e3o dos arquivos durante a solicita\u00e7\u00e3o do navegador possa ser feita. SE tiver d\u00favidas, indicamos que <strong>contate seu desenvolvedor<\/strong> ou t\u00e9cnico de confian\u00e7a.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\"><b>Conhe\u00e7a!<\/b><\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tAproveite e conhe\u00e7a outros produtos da Locaweb, como o VPS Locaweb, <a href=\"https:\/\/www.locaweb.com.br\/vps-locaweb\" target=\"_blank\" rel=\"noopener noreferrer\">clique aqui<\/a> e saiba mais!    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n","protected":false},"excerpt":{"rendered":"<p>Conceito Imagine que uma p\u00e1gina em seu site utilize o seguinte CSS: &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221; type=&#8221;text\/css&#8221;\/&gt; Ao habilitar a compacta\u00e7\u00e3o via Gzip\/deflate o fluxo de requisi\u00e7\u00f5es se dar\u00e1 da seguinte forma: Navegador requisita o arquivo style.css; O servidor encontra o arquivo style.css e o compacta; Responde com o arquivo style.css&#8230;<\/p>\n","protected":false},"author":6,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[119],"ht-kb-tag":[495,418],"class_list":["post-4613","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hospedagem-de-sites","ht_kb_tag-categoriacloud-e-dedicados","ht_kb_tag-categoriahospedagem"],"_links":{"self":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/4613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/comments?post=4613"}],"version-history":[{"count":7,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/4613\/revisions"}],"predecessor-version":[{"id":29096,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb\/4613\/revisions\/29096"}],"wp:attachment":[{"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/media?parent=4613"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb-category?post=4613"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.locaweb.com.br\/ajuda\/wp-json\/wp\/v2\/ht-kb-tag?post=4613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}