If you want to compress HTML, text, and XML files only, add this line to your configuration:
AddOutputFilterByType DEFLATE text/html text/plain text/xml |
This is the configuration I'm using because I don't want to compress images or PDF files or already compressed files such as zip files.
2 通过文件扩展名配置排他策略
If you want to compress all file types and exclude just a few, you would add something like this to your configuration (instead of the line from section 2.1):
SetOutputFilter DEFLATE |
This would compress all files except images (gif, jpg, and png), already compressed files (like zip and tar.gz) and PDF files which makes sense because you do not gain much by compressing these file types.
心情: 一般