Squid2.6反向 Proxy實現Web緩衝加速 主要的改進 1、融合加速和反向功能Major improvements to the way that Squid handles web proxy, accelerated and transparent proxy requests to make it easier to configure transparent and acceleration functionality. The default behaviour is to function as a standard HTTP proxy on each port that Squid is configured to listen on, but in addition in this release the keywords "accelerated" and "transparent" can be specified after each port to indicate to Squid the functionality that is to be enabled on that port. This means that the old config directives relating to httpd_accel_* are now deprecated. 2、行為分析Logging enhancements to allow even greater customization of the way Squid logs requests in the access-log or to syslog if requiredSupport for parsing X-Forwarded-For headers allowing access controls to be based on the real client IP even if behind secondary proxiesSupport for Etag and Vary HTTP headers. This further moves Squid towards HTTP/1.1 compliance. The Vary header field is used for improved caching and delivery of customized content to end clients, and the Etag is used similar to an MD5 checksum between client and server to determine if a web page has changed since it was last retrieved.
1、http_port、cache_peer規則使用由於httpd_accel_host 被http_port、cache_peer選項替代httpd_accel_port 由cache_port來定義
httpd_accel_uses_host_header由http_port vhost選項替代則
------------------------- ---------------------------
ajax.aaa .com請求 / | Squid | / 127.0.0.1 ajax.aaa.com 80
Sns.xxx.com請求 | | 211.100.100 sns.xxx.com 80
live.yyy.com請求 -- | 10.10.10.10/11 | ---- 169.100.100 live.yyy.com 81
tag.zzz.com 請求 / | /etc/hosts | / 58.100.100 tag.zzz.com 82
------------------------- --------------------------- http_port 110.10.10.10:80 transparent vhost vport cache_peer 127.0.0.1 parent 80 0 no-query originserver cache_peer 211.100.100 parent 80 0 no-query originserver cache_peer 169.100.100 parent 81 0 no-query originserver cache_peer 58.100.100 parent 82 0 no-query originserver 2、Log改進 A、Log記錄方式更改,可用記錄至系統Log或access-log,引入X-Forwarded-For headers功能後,Log可直接通過後台web的log進行分析B、X-Forwarded-For headers功能使後端被加速web的log更加便於分析,直接分析後端web的log即可分析使用者行為,原先版本後端web的log日誌全來自前端squid機器,無法從後端直接分析log