0

I have XAMPP with apache version 2.4.25 and PHP 5.6, then i enabled mod_deflate and mod_filter on httpd.conf in apache folder:

LoadModule deflate_module modules/mod_deflate.so
LoadModule deflate_module modules/mod_filter.so

I installed a new codeignter framework then write a .httaccess file in root folder like this:

RewriteEngine on
#RewriteBase /suli5
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

# compress text, html, javascript, css, xml:
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/png
AddOutputFilterByType DEFLATE image/jpg
AddOutputFilterByType DEFLATE text/html

# DEFLATE NOT COMPATIBLE BROWERS
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
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

Restart apache then I want to verify if compression gzip is run, so i check on

curl -I -H"Accept-Encoding: gzip" http://localhost/nees/

, but there is still no

Content-Encoding: gzip

Only give me like this:

TP/1.1 200 OK
Date: Thu, 27 Jul 2017 03:26:00 GMT
Server: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
X-Powered-By: PHP/5.6.30
Set-Cookie: ci_session=vmbl2tgvt838hb9mlbrg226f4hu7j43u; expires=Thu, 27-Jul-2017 05:26:00 GMT; Max-Age=7200; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

How to check if my mod_deflate is running well?

Andhika R.K.
  • 426
  • 1
  • 11
  • 30
  • So i try to change but still not working. I'm using XAMPP – Andhika R.K. Jul 28 '17 at 03:20
  • Hello Andhika, did you ever get this working ? I am also trying to use mod_deflate, but it isn't working for me. I don't know if this is a typo, but when loading the modules in Apache, it is LoadModule filter_module modules/mod_filter.so, and not LoadModule deflate_module modules/mod_filter.so – TJB Sep 27 '17 at 02:55

1 Answers1

0

In my case, i set this to httpd.conf:

<IfModule deflate_module>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog "logs/deflate_log" deflate
</IfModule>

Please note, - deflate_module it's my allias of mod_deflate.

M.Mario
  • 43
  • 1
  • 6