Estou usando o Google Chrome e tentei verificar se meu site tem a compactação gzip ativada com o monitor de rede de ferramentas do desenvolvedor integrado (F12). Depois que as ferramentas on-line informaram que meu site está compactado, mas meu navegador exibiu um tamanho diferente, testei-o com o link também. Agora os resultados:
Teste A
W10 de 64 bits, somente para o Google Chrome de 64 bits, somente IPv4
link Cabeçalho de resposta:
accept-ranges:bytes
cache-control:private
content-encoding:gzip
content-length:27980
content-security-policy-report-only:default-src https: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; report-uri https://stackoverflow.report-uri.io/r/default/csp/reportOnly
content-type:text/html; charset=utf-8
date:Sat, 18 Nov 2017 12:32:50 GMT
status:200
strict-transport-security:max-age=15552000
vary:Accept-Encoding,Fastly-SSL
via:1.1 varnish
x-cache:MISS
x-cache-hits:0
x-dns-prefetch-control:off
x-frame-options:SAMEORIGIN
x-request-guid:e8e35c63-8ada-4304-9775-518e2c94493a
x-served-by:cache-hhn1546-HHN
x-timer:S1511008370.083090,VS0,VE93
Monitor de rede:
168 KB
162 KB
O primeiro valor é o tamanho comprimido e é maior que o tamanho descompactado ?! Por que é diferente de content-length
?
link Cabeçalho de resposta:
accept-ranges:bytes
age:155455
cache-control:max-age=604800
content-encoding:gzip
content-length:13501
content-type:application/javascript
date:Sat, 18 Nov 2017 12:32:50 GMT
etag:"06eea28ff5ed31:0"
last-modified:Thu, 16 Nov 2017 17:20:12 GMT
status:200
vary:Accept-Encoding,Accept-Encoding
via:1.1 varnish
x-cache:HIT
x-cache-hits:51733
x-served-by:cache-hhn1543-HHN
x-timer:S1511008370.272246,VS0,VE0
Monitor de rede:
13.3 KB
38.2 KB
Isso parece correto.
Teste B
W10 de 64 bits, Google Chrome 62 bits, somente IPv6 (outro local de um amigo)
link Cabeçalho de resposta
Accept-Ranges:bytes
Cache-Control:private
Connection:keep-alive
Content-Length:101440
Content-Security-Policy-Report-Only:default-src https: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; report-uri https://stackoverflow.report-uri.io/r/default/csp/reportOnly
Content-Type:text/html; charset=utf-8
Date:Sat, 18 Nov 2017 12:34:04 GMT
Set-Cookie:prov=48760143-4086-135d-440f-590d1ece722d; domain=.superuser.com; expires=Fri, 01-Jan-2055 00:00:00 GMT; path=/; HttpOnly
Strict-Transport-Security:max-age=15552000
Vary:Accept-Encoding,Fastly-SSL
Via:1.1 varnish
X-Cache:MISS
X-Cache-Hits:0
X-DNS-Prefetch-Control:off
X-Frame-Options:SAMEORIGIN
X-Request-Guid:acf51572-2f08-4ef0-9695-d7217182eb1c
X-Served-By:cache-hhn1533-HHN
X-Timer:S1511008444.161788,VS0,VE102
Monitor de rede:
99.9 KB
99.1 KB
link Cabeçalho de resposta:
Accept-Ranges:bytes
Age:155530
Cache-Control:max-age=604800
Connection:keep-alive
Content-Length:39076
Content-Type:application/javascript
Date:Sat, 18 Nov 2017 12:34:05 GMT
ETag:"06eea28ff5ed31:0"
Last-Modified:Thu, 16 Nov 2017 17:20:12 GMT
Vary:Accept-Encoding,Accept-Encoding
Via:1.1 varnish
X-Cache:HIT
X-Cache-Hits:52224
X-Served-By:cache-hhn1529-HHN
X-Timer:S1511008445.494412,VS0,VE0
Monitor de rede:
38.6 KB
38.2 KB
Agora, o conteúdo do gzip está completamente ausente, embora o navegador esteja solicitando um site compactado:
GET / HTTP/1.1
Host: superuser.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Há algo de errado com o monitor de rede no Google Chrome? E qual poderia ser a razão pela qual o Teste B não recebe uma versão gzip do superuser.com?