Gzip issue with Safari

Francis Daly francis at daoine.org
Tue May 17 17:24:27 UTC 2016


On Mon, May 16, 2016 at 06:06:21AM -0400, mcofko wrote:

Hi there,

I confess I am not at all sure what it is you are asking about.

If it is clear to others who can help you, then there is no need for you
to do anything; but if it is generally unclear, perhaps you could describe
again what you do, what you see, and what you want to see instead?

> we have successfully enable gziping on the server side and it works
> perfectly with Chrome and FF (it auto compress the files that we want).

This seems to say that in FF you request /one.dds, and your nginx returns
a gzip-compressed version on the file one.dds. (And nginx compresses it
afresh on each request.)

> We're using compressed assets of type: .dds and .pvr.

*This* seems to say that in FF you request /one.dds, and your nginx
returns the contents of the pre-compressed file one.dds.gz.

I suspect that I am misunderstanding something.

> But the problem appears in Safari which
> doesn't accept .gz file type extension,

And *this* bit, I'm not sure what it is intended to mean. In Safari you
request /one.dds, and nginx returns something other than the content of
the file one.dds? Or it returns the content, but Safari does not like
it for some reason?

>         gzip on;
>         gzip_proxied any;
>         gzip_types image/png application/javascript application/octet-stream
> audio/ogg text/xml image/jpeg;
>         gzip_vary on;
>         gzip_comp_level 6;
>         gzip_min_length 1100;

That all says "sometimes, compress the response before sending it to
the client".

>         gzip_static on;

That says "if possible, send a pre-compressed file instead of the
uncompressed file".

> I noticed that Apache server enables something like this: 
> AddEncoding gzip .jgz
> AddType text/javascript .jgz

I think that that sets some response headers, depending on what the
request was.

> And this little change enables that Safari acknowledge gzip type and it also
> uploads it. 
> So the question is what are the possibilities on Nginx? Can we somehow add
> support for additional extensions?

What request do you make in Safari?

What response (http headers) do you get to that request?

What response do you want to get instead?

If you know that an Apache returns the response that you want, then
showing that output might answer the third question.

Alternatively, if Apache or nginx change their response based on the
User-Agent, you can try using "curl" to make the requests, using varying
User-Agent headers.

> Do you know any solutions?

Not yet; I don't know what the problem is.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list