1

I have two websites on my apache server. I have already enabled mod headers and deflates. in /etc/apache2/mod-available/deflate.conf i have written:

<IfModule mod_deflate.c>

SetOutputFilter DEFLATE
DeflateCompressionLevel 9


AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript


BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio

LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate

Header append Vary User-Agent env=!dont-vary


</IfModule>

but each time i check my website through the different commpression test the result is always: Compression status: Uncompressed

i tried to insert the code in /etc/apache2/site-available/mysite.com but it doesnt work. Have i missed something? I would be really gratefull if anyone can help.

Noon
  • 11
  • 3

1 Answers1

0

can you try adding in your v-host configuration, just for testing this:

<Location /tempFolder/>
        SetOutputFilter DEFLATE
</Location>

restart apache and see if the responses get gziped - eg by:

wget --header "Accept-encoding: gzip" http://host.name/tempFolder/file.txt

if compression works - you should get file.txt that can be unpacked with gunzip.

maybe the mod_deflate is not loaded after all?

pQd
  • 29,561
  • 5
  • 64
  • 106
  • Thank you for ur answer , i have this error: TTP request sent, awaiting response... 404 Not Found 2013-05-13 13:50:42 ERROR 404: Not Found.i am sure that i have activated the mod-deflate and mod-header. i dont know where the problem comes from? – Noon May 13 '13 at 15:49
  • but.. do you have tempFolder and there file.txt on your server? – pQd May 13 '13 at 19:45
  • i created a folder in my web folder. /var/www/mysite/tempFolder/ i gave 777 . i am not sure if its correct . but there is nothing inside. – Noon May 14 '13 at 07:46
  • please put a test file called file.txt there and add some randome content to it. – pQd May 14 '13 at 08:23
  • its done, /var/www/mysite/tempFolder/file.txt , then in command line: wget --header "Accept-encoding: gzip" http://www.mysite.com/tempFolder/file.txt response: HTTP request sent, awaiting response... 404 Not Found 2013-05-14 14:43:04 ERROR 404: Not Found. in v-host file: RewriteRule ^tempFolder/.txt - [L] – Noon May 14 '13 at 12:41
  • Are you sure that your domain is using that particular server? I advise you to check the logs and see if there is any incoming requests – Orphans Jun 03 '21 at 08:15