我正在寻找最快的方法来检查链接是否在远程服务器上工作/存在,如果没有尝试另一个链接。类似于 nginx 中的“try_files”,仅用于链接...
例如:
try first
header("Location:" . $VIDEO_1);
if there's no $VIDEO_1 try
header("Location:" . $VIDEO_2);
if there's no $VIDEO_2 try
header("Location:" . $VIDEO_3);
目前我正在使用一个检查大小并发送标题的函数......但是文件大小检查很慢
if($file_size > "9000000"){
header("Content-type: video/x-flv");
header("Location:" . $VIDEO . $dop);
}else{
header("Content-type: video/x-flv");
header("X-Accel-Redirect: /".$_GET["filename"].$dop);
}