0

I´ve activated mod_deflate on my server. The problem is that Google pagespeed says that my site needs a compression.

Have anybody an idea?

This code is in the /etc/apache2/apache2.conf. I restartet apache.

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain text/html text/xml
AddOutputFilterByType DEFLATE text/css text/javascript
AddOutputFilterByType DEFLATE text/js text/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript application/x-
javascript
</IfModule>

1 Answers1

1

You forgot to configure Output filter

SetOutputFilter DEFLATE

This is the Mod_deflate configuration i use to get 100% on Google Pagespeedinsight

# MOD_DEFLATE COMPRESSION
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/x-httpd-php

# SET VAR
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip

# DEFLATE NOT COMPATIBLE BROWERS
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

Don't forget to restart Apache service once the change has been made

Froggiz
  • 3,013
  • 1
  • 18
  • 30
  • You can remove the lines that account for buggy gzip support in Mozilla (Netscape) 4, which was distributed between 1997 and 1998 and is no longer in significant use. – Mike Scott Nov 19 '15 at 09:05
  • It is for the time travelers – Froggiz Nov 19 '15 at 09:06
  • Thanks guys - but the problem is not solved. mod_deflate is definitly activated and I´am on the right server :-). I´am a little bit desperate - because of wasting your and my time for such a problem like this. – ClubCola Nov 20 '15 at 11:20
  • Np ! can you try in shell `apache2ctl -M` to verify all installed mode ? can you check in your browser > webmaster tool > network > click on your page > check header, when you access to your website ? – Froggiz Nov 20 '15 at 11:31
  • Thanks. The `mod_deflate` is installed. In the header I found `content-encoding: gzip` – ClubCola Dec 16 '15 at 10:04
  • So, your trouble is solved ? – Froggiz Dec 16 '15 at 11:38