D
D
doriulbool2016-01-31 11:27:26
Apache HTTP Server
doriulbool, 2016-01-31 11:27:26

Why doesn't gzip compression and caching work on apache?

I welcome everyone.
Please help me figure out why gzip compression and caching on vps does not work.
Here is what is available and what I have already done:

/etc/httpd/conf.d$ httpd -v
Server version: Apache/2.2.29 (Unix)
Server built:   Sep 19 2014 10:30:37

/etc/httpd/conf.d$ apachectl -t -D DUMP_MODULES |grep deflate
Syntax OK
 deflate_module (shared)

/etc/httpd/conf/httpd.conf contains:
LoadModule deflate_module modules/mod_deflate.so
LoadModule mem_cache_module modules/mod_mem_cache.so
...
Include conf.d/*.conf
...
<filesMatch "\.(js|html|css)$">
SetOutputFilter DEFLATE
</filesMatch>

In the conf.d folder, I also created a *.conf configuration file in which I entered
<filesMatch "\.(js|html|css)$">
SetOutputFilter DEFLATE
</filesMatch>

.htaccess file contains:
<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>

<IfModule mod_gzip.c>
    mod_gzip_on         Yes
    mod_gzip_dechunk    Yes
    mod_gzip_item_include file		\.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include mime		^text\.*
    mod_gzip_item_include mime		^application/x-javascript.*
    mod_gzip_item_exclude mime		^image\.*
    mod_gzip_item_exclude rspheader	^Content-Encoding:.*gzip.*
</IfModule>

With the wget --header="Accept-Encoding: gzip" http://sitename/js/jquery.js command I get the original file .
Checkers for gzip show that it is enabled. Tests like https://developers.google.com/speed/pagespeed/ and https://varvy.com/pagespeed/ suggest to enable js and css caching and compression. The cache period is not specified - it means it does not work.
How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-01-31
@doriulbool

With wget --header="Accept-Encoding: gzip" http://sitename/js/jquery.js I get the original file
wget decompresses itself, or look at the logs , or bertal.ru or some cURL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question