Tôi nghĩ mod này cho apache
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html (2)
Và điều này cho Nginx
http://wiki.nginx.org/HttpGzipModule (1)
Âm thanh như những gì bạn cần tùy thuộc vào máy chủ bạn có kế hoạch để sử dụng. Phần còn lại là tùy thuộc vào bạn!
Xin lưu ý các module nginx cả cho phép tắt giải nén:
[edit] gzip
Syntax: gzip on | off
Default: off
Context: http
server
location
if in location
Reference: gzip
Enables or disables gzip compression.
Và đối phó với proxy:
[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
Lời chúc tốt nhất!
Nguồn:
1) http://forum.nginx.org/read.php?11,96472,214303
2) http://httpd.apache.org/docs/2.2/mod/mod_deflate.html#inflate (Phần Output nén)
Tôi nhầm lẫn: bạn có muốn gửi chỉ thị từ khách hàng đến máy chủ, bạn có muốn một cái gì đó được đảm bảo để vượt qua bất cứ điều gì không mong muốn proxy có thể được trong cách hoặc bạn muốn các chỉ thị để nói với các máy chủ không để nén dưới bất kỳ hoàn cảnh nào? – fvu
sau này ... Tôi muốn chỉ thị cho máy chủ không nén theo bất kỳ trường hợp nào – Homer6
Lưu ý rằng để ngăn tất cả các lần nén bạn có thể muốn sử dụng '*; q = 0' thay vì chỉ cấm gzip và giảm phát. Điều này đang được nói, tôi thực sự nghĩ rằng nhiều máy chủ không bận tâm với các tính năng Accept-Encoding như họ cần. Ngoài ra còn có 'Accept-Encoding: identity' ... –