mod_deflate in .htaccess and google pagespeed

9.9k Views Asked by At

i have a linode sever with centos 6 , as it wont support mod_gzip, i am using mod_deflate.

this is my code in .htacess

<IfModule mod_deflate.c>
  <FilesMatch "\\.(js|css|html|htm|php|xml)$">
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>

when i tested using http://www.whatsmyip.org/http-compression-test/ , its saying 'my site is gzipped' , but when i used pagespeed in chrome, it still suggest 'Enable compression'

whats wrong? any problem with my .htaccess code?

2

There are 2 best solutions below

0
On

I've had this same problem. It seems pagespeed in Chrome sometimes gives the wrong results. I recommend using http://webpagetest.org or http://gtmetrix.com if you really want to be sure. You should always test these sorts of things on different websites, don't just rely on one or two tests. Some websites or tools give the wrong results.

0
On

I used deflate mode in this way:

<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
</IfModule>

And it's working perfectly for me. Pagespeed for my site is: Desktop: 91 Mobile: 83

References which I have used for my site:

  1. http://www.quickregisterseo.com/improve-google-page-speed-score-wordpress-without-plugins/
  2. https://dzone.com/articles/steps-improve-your-pagespeed-insight-score