S
S
Sergey Pugovkin2020-08-20 18:56:26
linux
Sergey Pugovkin, 2020-08-20 18:56:26

How to create a file in linux with content suitable for serving via http as "Content-Encoding: gzip"?

The question is about the formation of the content body.
How to generate http headers, how to serve compressed files through nginx, etc. - not about this question. Interested in the creation of a valid http-body, a la "Content-Encoding: gzip".
Those. the question is not about how to compress a file, but about how to compress a string so that it can be returned as is in a compressed http response.
gzip is ok? In my opinion yes, but I would like answers from those who know for sure.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pugovkin, 2020-08-20
@Driver86

Yes. This successfully decompresses the responses:
curl -sH 'Accept-encoding: gzip' example.com | gunzip -
Accordingly, the reverse is also true.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question