Forums

Mansoor
Mansoor
Offline
Resolved
0 votes
I'm wondering why gzip isn't enabled by default in clearOS apache server?

I enabled it by adding the following near the end of /etc/httpd/conf/httpd.conf file

<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
Saturday, December 15 2018, 01:11 AM
Share this post:
Responses (1)
  • Accepted Answer

    Saturday, December 15 2018, 06:14 AM - #Permalink
    Resolved
    0 votes
    Dunno. You could also throw it at the end of your .htaccess file rather than your httpd.conf file, if you're using a .htaccess file in your webroot. I guess it's a matter of what your site or sites are doing, not to mention how many sites you're running. It's cpu intensive to some extent. I don't think it works well for all servers and their functionality, slowing some of them down. It might work well for your site's structure, but not so well for others. Why include it in a distro if it's not advantageous for most if not all folks?
    The reply is currently minimized Show
Your Reply