我有基于flussonic / erlyvideo + squid代理缓存(本地网络)的hds流服务器。 我需要制作squid缓存视频流片段。 Squid可以从inventos.ru缓存视频(mime-type fragment header text / plain),但无法从我的服务器缓存:video / f4f片段mime-type。
如何使squid缓存视频/ f4f片段。
鱿鱼配置:
acl all src all
acl mynet src 192.168.0.0/255.255.255.0
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 8080 # stream hds
acl Safe_ports port 1935 # rtmp
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow all
http_access allow mynet
http_port 3128
acl yammervideo dstdomain *.yammer.com
acl inventos dstdomain inventos.ru
acl targetvideodomain dstdomain v.tst.com
#cache allow video
#cache allow yammervideo
cache allow inventos
cache allow targetvideodomain
cache allow all
#We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
cache_dir ufs /var/squidcache 500 16 256
#Suggested default:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
# Don't upgrade ShoutCast responses to HTTP
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
# TAG: extension_methods
# Squid only knows about standardized HTTP request methods.
# You can add up to 20 additional "extension" methods here.
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
hosts_file /etc/hosts
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
Squid访问日志(简称):
1358797512.502 939 85.21.245.191 TCP_MISS/200 918268 GET http://v.tst.com/ren/mm1.mp4/hds/tracks-1,2/Seg1-Frag9 - DIRECT/91.218.230.83 video/f4f
1358797516.090 936 85.21.245.191 TCP_MISS/200 571690 GET http://v.tst.com/ren/mm1.mp4/hds/tracks-1,2/Seg1-Frag10 - DIRECT/91.218.230.83 video/f4f
存储日志:
1358797618.493 RELEASE -1 FFFFFFFF D16DC1B649CD3523AC0BC86E7C8ECB45 200 1358797616 -1 -1 video/f4f 1737948/1737948 GET http://v.tst.com/ren/mm1.mp4/hds/tracks-1,2/Seg1-Frag28
1358797623.862 RELEASE -1 FFFFFFFF 284EB9F58EF52724EF68378D237F0594 200 1358797622 -1 -1 video/f4f 1578659/1578659 GET http://v.tst.com/ren/mm1.mp4/hds/tracks-1,2/Seg1-Frag29