测试大文件下载
curl -I "http://resource.tsk.erya100.com/TS/flv/TS180/5836/9.flv?t=1430796561727"
单条转发模式in per remap mode
在remap.config中添加一条
map http://resource.tsk.erya100.com/ http://resource.tsk.erya100.com/ @plugin=background_fetch.so @pparam=background_fetch.config
map http://files2.changyou.com/ http://files2.changyou.com/ @plugin=background_fetch.so @pparam=background_fetch.config
其中background_fetch.config配置如下
include Content-Type video/x-flv
exclude Content-Length <102400000
如何开启日志?
在configs.h中定义了该插件的名字"background_fetch",在records.config中配置上
CONFIG proxy.config.diags.debug.enabled INT 1
CONFIG proxy.config.diags.debug.tags STRING regex_revalidate.*|background_fetch.*
测试
使用curl来开启range模式
curl -o /dev/null -r 0-10 -vx 127.0.0.1:8081 "http://resource.tsk.erya100.com/TS/flv/TS180/5836/9.flv?t=1430796561727"
curl -o a.zip -r 0-1000 -vx 127.0.0.1:8081 "http://files2.changyou.com/slzj/fullclient/gw/DS-20150414-2.zip"
curl -o a.exe -r 0-1000 -vx 127.0.0.1:8081 "http://files2.changyou.com/ldj/49440_20150313_LDJ_PRC_ZS_0.80.9532_BD3/LDJ_ldjdraggw_0.80.9532.exe"
如果间隔一定时间发送了两个range请求,background-fetch正在进行中,它还会重复去回源该文件吗?
curl -I "http://resource.tsk.erya100.com/TS/flv/TS180/5836/9.flv?t=1430796561727"
单条转发模式in per remap mode
在remap.config中添加一条
map http://resource.tsk.erya100.com/ http://resource.tsk.erya100.com/ @plugin=background_fetch.so @pparam=background_fetch.config
map http://files2.changyou.com/ http://files2.changyou.com/ @plugin=background_fetch.so @pparam=background_fetch.config
其中background_fetch.config配置如下
include Content-Type video/x-flv
exclude Content-Length <102400000
如何开启日志?
在configs.h中定义了该插件的名字"background_fetch",在records.config中配置上
CONFIG proxy.config.diags.debug.enabled INT 1
CONFIG proxy.config.diags.debug.tags STRING regex_revalidate.*|background_fetch.*
测试
使用curl来开启range模式
curl -o /dev/null -r 0-10 -vx 127.0.0.1:8081 "http://resource.tsk.erya100.com/TS/flv/TS180/5836/9.flv?t=1430796561727"
curl -o a.zip -r 0-1000 -vx 127.0.0.1:8081 "http://files2.changyou.com/slzj/fullclient/gw/DS-20150414-2.zip"
curl -o a.exe -r 0-1000 -vx 127.0.0.1:8081 "http://files2.changyou.com/ldj/49440_20150313_LDJ_PRC_ZS_0.80.9532_BD3/LDJ_ldjdraggw_0.80.9532.exe"
然后在我们看到如下日志信息
等待片刻,我使用curl去请求该flv视频,发现它已经硬盘命中了
测试中遇到的现象
当我使用curl去发送某个mp4大文件的range请求来触发background-fetch时,我发现该插件表现迟缓,并未成功下载该文件。
如果间隔一定时间发送了两个range请求,background-fetch正在进行中,它还会重复去回源该文件吗?
下载大文件的效果咋样?
总之,该插件性能还需进一步改进,对大文件的回源下载还需进一步改进。