Gzip compression using Apache server

0

How to enable gzip compression in Apache? I took a look and saw that it is htaccess , but every article I read passes a different statement. Is there any material, article or thing of the kind that can give me a direction?

    
asked by anonymous 03.04.2014 / 21:50

2 answers

2

Hello, I think this article may have what you're looking for:

How To Optimize Your Site With GZIP Compression

You should add the following code to your htaccess:

# comprimir texto, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Ou, comprimir alguns tipos de arquivos pela extenção:
<files *.html>
SetOutputFilter DEFLATE
</files>

It was the most didactic I found on the subject, I hope it is useful.

    
03.04.2014 / 22:04
1
AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/javascript

There is a great reference for this feature and other optimizations in the links below:

04.04.2014 / 00:33