K
K
Karen Kratyan2016-02-12 17:23:15
Gzip
Karen Kratyan, 2016-02-12 17:23:15

How to check if the file given by the server is indeed archived (defalate, gzip)?

There is a server with nginx. With compression setting:

gzip on;
gzip_buffers 16 8k;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon application/vn↪ d.ms-fontobject font/opentype application/x-font-ttf;
gzip_vary on;
gzip_disable "msie6";

And then it turns out that it gives out the title, that the document is compressed, and the document itself is actually uncompressed. One nginx gives a compressed document, and the other an uncompressed document and with the headers set in both cases. I understand that the only person who doesn't get the compressed document is msie6.
So you need to check whether the document is really compressed or just the title is just specified.
Well, in general, this is related to yml for Yandex Market. And here is what they write:
Received a comment from experts that this is a mistake on the side of the store. The server gives our robot information that the price list file is archived, but in fact it is not. At the same time, the store server answers our online checker correctly (therefore, the price list is being checked there).

Could this be bullshit or?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2016-02-12
@dimonchik2013

the easiest way is to download cURL, it does not decompress by default,
see examples
php.net/manual/en/function.curl-multi-exec.php
pycurl.io/docs/latest/unicode.html#writing-to-files
write to the file and then unzip it
on the machine is done like this: zlib / gzip decompress is applied on the fly and then it is read in some kind of encoding, and by mistake you can see if it was compressed
or look here www.bertal.ru but xs, there it can decompress

V
Vlad Zhivotnev, 2016-02-14
@inkvizitor68sl

curl -H "Accept-encoding: gzip" blablabla

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question