Is gzip compression enabled by default in C5?

Permalink 1 user found helpful
I checked some of my C5 websites on this website:http://www.gidnetwork.com/tools/gzip-test.php...

It shows gzip compression enabled. Just wondering if it's enabled by default in 5.5+ versions. I have seen in the forum where people are suggesting gzip compression. Just wondering why would they suggest if it's enabled by default.

BlueFractals
 
apc123 replied on at Permalink Reply
apc123
gzip compression is a function of the web server and not of Concrete5.

Here is a basic overview:
http://betterexplained.com/articles/how-to-optimize-your-site-with-...
adajad replied on at Permalink Reply
adajad
mod_deflate is often enabled by default in Apache, so all you need to do is add the following to your .htaccess

# compress text, 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


Or if you want to compress files based on extension:
<FilesMatch "\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
BlueFractals replied on at Permalink Reply
BlueFractals
Yes I tried that but I couldn't see any difference before and after adding these lines in .htaccess. I tested it here:http://www.gidnetwork.com/tools/gzip-test.php... and the before and after results are exactly the same.

Not sure if I am doing anything wrong. Here is my .htaccess file:

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
Steevb replied on at Permalink Reply
Steevb
I don't use 'AddOutputFilter'

I use:
<FilesMatch "\.(ico|xhtml|txt|js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
BlueFractals replied on at Permalink Reply
BlueFractals
I used both of them, AddOutputFilter as well as <FilesMatch> and also tried without AddOutputFilter but no change at all.
adajad replied on at Permalink Reply
adajad
can you check if mod_deflate is enabled in you httpd.conf?
BlueFractals replied on at Permalink Reply
BlueFractals
Yes it is enabled.

LoadModule deflate_module modules/mod_deflate.so
adajad replied on at Permalink Reply
adajad
mkay...

have you run your site through http://www.webpagetest.org/ ? I find that page giving very accurate information about sites and also good suggestions on how to fix the issues found.

Just a note, though. I learned today that 'AddOutputFilterByType' is deprecated, so you should use 'AddOutputFilter' or 'SetOutputFilter' instead.
BlueFractals replied on at Permalink Reply
BlueFractals
Thanks for that link. It looks useful.

Yeah, I tried AddOutputFilter instead of the deprecated one but still the result is same.

I always get this same result whether or not I use the filter settings on .htaccess:

Web page compressed?    Yes
Compression type?    gzip
Size, Markup (bytes)    13,618
Size, Compressed (bytes)    3,593
Compression %    73.6


Does that compression % look good enough anyway? Maybe C5 already has php-equivalent of the filters enabled - I'm not sure. Perhaps that's why it looks like the content is compressed regardless of the .htaccess modification.
adajad replied on at Permalink Reply
adajad
A compression of 73.6% has compressed your files down to three quarters of their original size, and I would consider that pretty good.
TooqInc replied on at Permalink Reply
TooqInc
Strange to trip across this tonight as I just dealt with this today.

In my WHM, under the server tweaks, gzip was enabled but I was mucking about today and saw on page speed that compression was not enabled for any of my sites. Some google-fu later and it turns out that server tweaks is kind of like saying "sure, you can have that" but unless you configure Apache with it turned on and re-compile it, it is not operational.

Check your Apache configuration and either recompile with the setting for Deflate turned on (5th or 6th step), or call your host provider and get them to do it.

All of my sites are running really snappy now. I had page speed of one go from 55/56 to 94 and others from mid 60's to low 90's. Totally worth getting it sorted out. I've also added config/site.php and htaccess tweaks for some stuff that has helped.
TooqInc replied on at Permalink Reply
TooqInc
One last thing: the easy way to see if it is enabled and running in Apache is if you see an option for "Optimize Website" under Software/Services in cPanel. If it's not there, it ain't deflating anything.