0

I have tried GZip code provided by gtmatrix and it works fine on many website but now when I try it on one of my website its not working.

I have checked using phpinfo() and the GZip shows enabled.

But when I check website it ask for GZip compression. Why it happens?

And when I click to that GZip tab all they are JavaScript so I tried both of below code

I tried first.

# compress text, HTML, JavaScript, CSS, and 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

Then for JavaScript:

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</ifmodule>

But nothing seems to be working.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
user2477139
  • 608
  • 1
  • 6
  • 21
  • possible duplicate of [mod\_deflate for css and js](http://stackoverflow.com/questions/3896976/mod-deflate-for-css-and-js) – Giacomo1968 Nov 29 '13 at 18:22

1 Answers1

0

You say this:

I have checked using phpinfo() and the GZip shows enabled.

Then you are showing snippets of code that are clearly Apache2 configs or .htaccess overrides for Apache2 that activate mod_deflate. Two different things. Are you in control of your Apache2 server on an admin level? Are you sure that mod_deflate is installed & active on that setup?

The thing is that what is shown in phpinfo() is strictly for PHP and controlled within php.ini. If your server is set with PHP level Gzip compression, that is a completely different thing than Apache configs or .htaccess settings that adjust for mod_deflate.

That said, how are you testing that Gzip compression? Via an online tool? I prefer to use the GIDNetwork test page for Gzip compression tests. Very simple & clear.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
  • hi thanks...how i can check mod_deflate is available?when i check your suggested tool it shows compressed with gzip but in gtmatrix or google pagespeed it ask for gzip and they all are js – user2477139 Nov 29 '13 at 18:14
  • So you are having problems deflating JavaScript? Look at this question: http://stackoverflow.com/questions/3896976/mod-deflate-for-css-and-js – Giacomo1968 Nov 29 '13 at 18:22