标题(“Content-Encoding:gzip”)支持哪些文件类型?

I'm using this snippet:

// ... snip

header("Content-Encoding: gzip");
include some_file;

// ... snip

to serve zipped content.

What types of encoding can I serve this way. i.e what can i put in for some_file?

This just tells the receiver that the sender compressed the payload using gzip compression algorithm and it will need to be decompressed when received. For example a server may compress a very large page and send it to the client, the client will need to decompress it before it can be processed further.

As @Evert points out, the client must be able to accept gzipped data.

This does not have anything to do with downloading gzip archives so file type is irrelevant.

If you want to specify the type of file being downloaded, this is done with the Content-Type header. For example:

header("Content-Type: application/gzip"); // for GZIP archive files
header("Content-Type: application/zip"); // for ZIP archive files

Or more generically:

header("Content-Type: application/octet-stream"); // for arbitrary binary data

Everything, as long as it's gzipped. But you should only serve files like that if the client sends: Accept-Encoding: gzip