1

I have Apache 2.4.37 without Nginx and with PHP 7.2.24. When I download header of my site:

$ curl -I  -H  "Accept-Encoding: gzip" https://mysite/
HTTP/2 200
server: Apache/2.4.37 (centos) OpenSSL/1.1.1k
x-powered-by: PHP/7.2.24
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
content-type: text/html; charset=utf-8

I can't see Content Encoding gzip in the Header, but if I download index page of my site via: curl -o index.html -H "Accept-Encoding: gzip" https://mysite/ index.html is a gzip archive.

When I download header of my site CSS page(https://mysite/file.css):

$ curl -I  -H  "Accept-Encoding: gzip" https://mysite/
HTTP/2 200
server: Apache/2.4.37 (centos) OpenSSL/1.1.1k
accept-ranges: bytes
vary: Accept-Encoding
content-encoding: gzip
cache-control: max-age=31536050
content-length: 5135
content-type: text/css

So, where is "content-encoding: gzip" in the Header of php page of my site?

I tried to add header('Content-Encoding: gzip'); in the Php code of index.php, but Browser said that invalid Encoding. Thanks.

DimaGra
  • 11
  • 1

0 Answers0