PHP: litespeed 的 x-sendfile
PHP: x-sendfile for litespeed
我在 apache 中使用以下代码:
$file = 'a.mp3';
$mime = mime_content_type($file);
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-type: ' . $mime);
header('Content-Length: ' . filesize($file));
header('X-Sendfile: ' . $file);
exit();
但是新的服务器管理员让我把它改成litespeed版本
如何?
试试下面的代码
$file = 'https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4';
$mime = 'video/mp4';
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-type: ' . $mime);
header('Content-Length: ' . filesize($file));
// header('X-Sendfile: ' . $file);
header('X-LiteSpeed-Location:' . $file);
exit();
我在 apache 中使用以下代码:
$file = 'a.mp3';
$mime = mime_content_type($file);
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-type: ' . $mime);
header('Content-Length: ' . filesize($file));
header('X-Sendfile: ' . $file);
exit();
但是新的服务器管理员让我把它改成litespeed版本
如何?
试试下面的代码
$file = 'https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4';
$mime = 'video/mp4';
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-type: ' . $mime);
header('Content-Length: ' . filesize($file));
// header('X-Sendfile: ' . $file);
header('X-LiteSpeed-Location:' . $file);
exit();