Welcome! Log In Create A New Profile

Advanced

Re: Gzip issue with Safari

Francis Daly
May 18, 2016 01:06PM
On Wed, May 18, 2016 at 03:37:51AM -0400, mcofko wrote:

Hi there,

> enabled gziping on nginx and it's working on Chrome perfectly (we know this
> looking at network tab in developer tools, where we can see the size of the
> gzipped file one.dds that needed to be downloaded and it's around 2MB while
> the original one.dds filesize is around 4MB).

I think this means that you can see the http request that Chrome makes,
and you can see the response that nginx gives, and that they are what
you want.

Can you use "curl" to make the same request, and see the same
response? That usually makes it easier to see what exactly is going on,
because there are fewer layers in the way.

(I'm not sure whether your nginx is serving the content of the file
one.dds.gz as-is, or is serving the content of the file one.dds and
gzip'ing it on-the-fly. Maybe it makes a difference; maybe it doesn't.)

> I also checkede the header of
> the file, and Accept-Encoding has values GZIP, deflate, sdch.

I think that that refers to the http request header; with luck you
will be able to reproduce that in curl, where the full communication
can be copy-paste'd.

> But the same file loaded on iMac with Safari browser takes/loads 4MB, which
> clearly states that the Safari somehow doesn't accept or ignores files with
> .gz extension. I also checked file header and Accept-Encoding has: GZIP,
> deflate.

Can you see the differences between the request that Chrome made and
the request that Safari made? That might indicate why nginx gave different
responses.

If you can re-create both requests in curl you'll be able to see the
different responses from your nginx, and maybe that will give you a hint
as to where the problem is.

> The same problems were already reported on some other forums, but they were
> able to solve the problem, because they're using Apache, which enables
> adding options as:
> AddEncoding gzip .jsz
> AddType text/javascript .jsz

I don't see those other forums you mention.

I don't see that those options will make a difference unless you are
actually requesting /one.jsz or /one.dds.jsz. But perhaps there are
extra things happening in the apache config that makes things work.

nginx does have an add_header directive to add general headers; and has
a types directive to set one header based on filename extension.

It may be that some combination of those could help you; but I suspect
that the full answer will be different.

> I hope this links will help you understand my problem:
> http://blog.bigsmoke.us/2012/01/16/safari-ignores-content-type-for-gz-suffix
> http://stackoverflow.com/questions/962721/pre-compressed-gzip-break-on-chrome-why

They seem to say that you shouldn't ask Safari to request /one.js.gz if
you want Safari to use the response as a script.

That doesn't seem related to the rest of your email.

I suspect I'm missing something.

And I still don't know what request you make, what response you get,
or what response you want. So I'll let someone else get involved.

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Gzip issue with Safari

mcofko May 16, 2016 06:06AM

Re: Gzip issue with Safari

itpp2012 May 16, 2016 06:23AM

Re: Gzip issue with Safari

mcofko May 16, 2016 06:28AM

Re: Gzip issue with Safari

Francis Daly May 17, 2016 01:26PM

Re: Gzip issue with Safari

mcofko May 18, 2016 03:37AM

Re: Gzip issue with Safari

Francis Daly May 18, 2016 01:06PM

Re: Gzip issue with Safari

sphax3d August 09, 2016 04:14AM

Re: Gzip issue with Safari

Valentin V. Bartenev August 09, 2016 10:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready