2008年11月5日 星期三

Squid Proxy server bypass

不要進行 cache 的設定值:
就如同我們在原理的部分提到的,有些網站的資料事實上並沒有做為 cache 的需要,例如 CGI 檔案就是一個很鮮明的案例!所以,一般而言
, squid 在一開始就會自動幫我們設定好底下這三行:
 
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
 
上面這三行的意思是:『只要在網址列出現了 cgi-bin 的字樣時,該網頁資料就不進行 cache 的動作!』這樣一來,可以避免我們的主機存
放太多的垃圾啊! ^_^!當然啦,在某些時候,例如您所在的網域真的是很慢,同時又沒有適合的上層 Proxy 的環境下,那麼將 cgi 之類的
網頁 cache 下來,也未嘗不是一個可以節省瀏覽時間的一個方法!如果確定要將 cgi-bin 底下的網頁也存下來的話,那麼就將上面三行註解
掉囉!
 




squid.conf檔部份

# TAG: no_cache
# A list of ACL elements which, if matched, cause the reply to
# immediately removed from the cache. In other words, use this
# to force certain objects to never be cached.
#
# You must use the word 'DENY' to indicate the ACL names which should
# NOT be cached.
#
# There is no default. We recommend you uncomment the following
# two lines.
#
#acl QUERY urlpath_regex cgi-bin \?
#no_cache deny QUERY

#(by tung)
acl QUERY urlpath_regex cgi-bin \? ncku.edu.tw \.ram$
no_cache deny QUERY





範例:

acl bypass_net dst 172.16.0.0/16 172.28.0.0/16 210.71.212.21/255.255.255.255 220.229.162.21/255.255.255.255

acl bypass_web dstdomain .railway.gov.tw .railway.hinet.net .exyhtg01.*

acl QUERY urlpath_regex cgi-bin \? \.cgi \.asp \.php \.php3 \.cfm \.jsp



no_cache deny bypass_web

no_cache deny bypass_net

no_cache deny QUERY

Windows Server AD dsquery (查詢指令)

Windows Server  AD  dsquery     ( 查詢指令 ) 通用的參數:    -limit 0   指定傳回符合搜尋條件的物件數目,如果值是 0 ,將傳回所有符合的物件。 如果不指定此參數,根據預設將只顯示前 100 個結果。 ...