O
O
Outsider V.2015-02-14 21:49:56
PHP
Outsider V., 2015-02-14 21:49:56

Why is the Content-Encoding header not coming?

Compression is enabled on the server with mod_deflate:

<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/html
<FilesMatch ".(css|xml|txt|html|htm|php|js) $">
Header set Vary: Accept-Encoding
</FilesMatch>
</IfModule>

When I request a txt file using https://webmaster.yandex.ua/server-response.xml , I get this:

HTTP Status Code: "200 OK"
Server Response Time: 311ms
Site IP: 31.170.164.134
Encoding: UTF-8(unicode-1-1-utf-8, UTF8)
Page Size: 23.51Kb
Date: Sat, 14 Feb 2015 18 :40:33 GMT
Server: Apache
Last-Modified: Fri, 13 Feb 2015 20:13:08 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: no-cache
Content-Length: 114
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/plain

When I visit the site through Firefox or Chrome, the headers are like this (taken from Chrome):
Request:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:ru-RU,ru; q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:PHPSESSID=b41009fc0257aff276801119e5ee59c3; _ym_visorc_27969231=w
Host:audiophilesoft.com
If-Modified-Since:Fri, 13 Feb 2015 20:13:08 GMT
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36

Answer:
HTTP/1.1 200 OK
Date: Sat, 14 Feb 2015 18:43:08 GMT
Server: Apache
Last-Modified: Sat, 14 Feb 2015 18:43:02 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding
Cache-Control: no-cache
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/plain
Transfer-Encoding: chunked

Why doesn't the Content-Encoding: gzip header come up when I request a file or page through a browser ? It turns out that the server sends uncompressed data to browsers? But the browser sends Accept-Encoding.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-02-25
@ShamblerR

Try going from here
onedev.net/post/324

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question