Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Safari not accept GZIP compression?

Tags:

http

gzip

safari

I have a pretty big JavaScript file here which I want to embed into my website. The HTTP server is smart enough to GZIP the file before delivering it to the browser.

However, I tested with Google Chrome and Safari.

On Chrome, it works very well. 400K go down compressed to around 100k:

first

second

BUT on Safari compression doesn't work:

third

fourth

The funny thing is, in gz2b.png you can clearly see that content-encoding is set to "gzip".


Note: I already read up on a GZIP-Bug in Safari where files cannot end on ".gz" or Safari won't accept GZIP. Since my file does not end on .gz this problem shouldn't be an issue.

like image 515
Timo Ernst Avatar asked Sep 11 '12 12:09

Timo Ernst


1 Answers

I've run into this problem as well, while trying to optimize the load time of a website on iOS7 Safari mobile iPad.

  • Encoded = uncompressed filesize, from server
  • Decoded = uncompressed filesize, locally
  • Transferred = uncompressed file size + headers sent and received
  • Content-Length = compressed file sent, from server

Safari chose a really weird way of representing these numbers in their debugger.

like image 162
Apollo Clark Avatar answered Sep 28 '22 06:09

Apollo Clark