0

I use gzip module of nginx to compress documents. When gzip is enabled nginx will automatically send content-ending of gzip with HTTP headers, right?

Without adding any PHP header header() or HTML meta http-equiv, this works perfectly. However, I have seen on online tutorial for adding header for gzip whether by PHP or HTML meta to assist browser to process gzipped data.

Is it really needed? Since I was not sure if this is needed on some conduction (that I am not testing), I asked this question for further clarification of the issue.

Googlebot
  • 1,047
  • 2
  • 15
  • 30

1 Answers1

1

Nginx compresses data on mime type. For static files it uses the mime.types file for this but for data from a backend you do need to set the mime type unless the default is already text/html or you've added the default to the types of be compressed. See http://wiki.nginx.org/HttpGzipModule#gzip_types

Martin Fjordvald
  • 7,749
  • 1
  • 30
  • 35