เก็บได้แล้วครับ ทุก vdo เลย
ลองเอา pc มาทำเซริฟ ต่อผ่าน เซริฟเดิม Ubuntu Multiwan
ลง Ubuntu 8.10 ทำ dhcp3 + iptable + squid 2.7
เก็บได้ ทุก Vdo ที่เปิด ดูใน youtube (แต่ใน ro89 ยังไม่ได้ลอง
อิๆ )
สร้างไฟล /usr/local/bin/store_url_rewrite (script ข้างในก็ตามเวป )
บางส่วนที่เพิ่มใน squid
cache_mem 128 MB
maximum_object_size 500 MB
maximum_object_size_in_memory 65535 KB
cache_swap_low 98%
cache_swap_high 99%
store_dir_select_algorithm round-robin
ipcache_size 2048
ipcache_low 98
ipcache_high 99
fqdncache_size 2048
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
acl snmpcommunity snmp_community public
snmp_port 3401
snmp_access allow snmpcommunity localhost
snmp_access deny all
zph_mode tos
zph_local 0ื30
zph_parent 0
zph_option 136
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i \.flv$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
refresh_pattern ^http://sjl-v[0-9]+\.sjl\.youtube\.com 10080 90% 999999 ignore-no-cache override-expire ignore-private
refresh_pattern ^http://(.*?)/get_video\? 10080 90% 999999 override-expire ignore-no-cache ignore-private
refresh_pattern ^http://(.*?)/videodownload\? 10080 90% 999999 override-expire ignore-no-cache ignore-private
refresh_pattern . 0 20% 4320
acl store_rewrite_list url_regex ^http://(.*?)/get_video\?
acl store_rewrite_list url_regex ^http://(.*?)/videodownload\?
cache allow store_rewrite_list
storeurl_access allow store_rewrite_list
storeurl_access deny all
storeurl_rewrite_program /usr/local/bin/store_url_rewrite
# Had to uncomment this again, because I couln'd login to google mail using IE6 (firefox had no trouble):
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
# --BEGIN-- youtube_cache config for squid
url_rewrite_children 20
acl youtube_query url_regex -i \.youtube\.com\/get_video
acl metacafe_query dstdomain v.mccont.com
acl dailymotion_query url_regex -i proxy\-[0-9][0-9]\.dailymotion\.com\/
acl google_query dstdomain vp.video.google.com
acl redtube_query dstdomain dl.redtube.com
acl xtube_query url_regex -i p[0-9a-z][0-9a-z]?[0-9a-z]?\.xtube\.com\/videos
acl vimeo_query url_regex bitcast\.vimeo\.com\/vimeo\/videos\/
url_rewrite_access allow youtube_query
url_rewrite_access allow metacafe_query
url_rewrite_access allow dailymotion_query
url_rewrite_access allow google_query
url_rewrite_access allow redtube_query
url_rewrite_access allow xtube_query
url_rewrite_access allow vimeo_query
redirector_bypass on
# --END-- youtube_cache config for squid
-------
เปิด vdo
http://www.youtube.com/watch?v=cfjQujYrfEkดูใน access.log
TCP_MEM_HIT/200 8223828 GET
http://www.youtube.com/get_video?video_id=cfjQujYrfEk&t=OEgsToPDskJyIoLVrKU4fgcb6Dmz3BFb&$z3BFb&el=detailpage&ps= - NONE/- video/flv
vdo
http://www.youtube.com/watch?v=tbOiugjp63o&feature=channel TCP_MEM_HIT/200 7630589 GET
http://www.youtube.com/get_video?video_id=tbOiugjp63o&t=OEgsToPDskIq8K9tO_WP6SmzzFMYCc9W&$ YCc9W&el=detailpage&ps= - NONE/- video/flv
ติดตรงที่ยังเป็น TCP_MEM_HIT ช่วยดูให้ทีครับ .....ทำไงจะให้เป็น TCP_HIT