我认为这个 mod 的 apache
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html (2)
这对于 Nginx
http://wiki.nginx.org/HttpGzipModule (1)
听起来像是您需要的,具体取决于您计划使用的服务器。剩下的就看你了!
请注意nginx模块都允许关闭解压:
[edit] gzip
Syntax: gzip on | off
Default: off
Context: http
server
location
if in location
Reference: gzip
Enables or disables gzip compression.
并处理代理:
[edit] gzip_proxied
Syntax: gzip_proxied off | expired | no-cache | no-store | private | no_last_modified | no_etag | auth | any ...
Default: off
Context: http
server
location
Reference: gzip_proxied
It allows or disallows the compression of the response for the proxy request in the dependence on the request and the response. The fact that, request proxy, is determined on the basis of line "Via" in the headers of request. In the directive it is possible to indicate simultaneously several parameters:
off - disables compression for all proxied requests
expired - enables compression, if the "Expires" header prevents caching
no-cache - enables compression if "Cache-Control" header is set to "no-cache"
no-store - enables compression if "Cache-Control" header is set to "no-store"
private - enables compression if "Cache-Control" header is set to "private"
no_last_modified - enables compression if "Last-Modified" isn't set
no_etag - enables compression if there is no "ETag" header
auth - enables compression if there is an "Authorization" header
any - enables compression for all requests
[edit] gzip_types
最良好的祝愿!
资料来源:
1) http://forum.nginx.org/read.php?11,96472,214303
2)http://httpd.apache.org/docs/2.2/mod/mod_deflate.html#inflate(部分输出解压)