Skip to content
Snippets Groups Projects
Commit 957b9e8b authored by Robin Appelman's avatar Robin Appelman
Browse files

send last modified header for media

parent 900adb35
Branches
No related tags found
No related merge requests found
...@@ -125,11 +125,19 @@ if($arguments['action']){ ...@@ -125,11 +125,19 @@ if($arguments['action']){
OC_MEDIA_COLLECTION::registerPlay($songId); OC_MEDIA_COLLECTION::registerPlay($songId);
header('Content-Type:'.$ftype); header('Content-Type:'.$ftype);
// calc an offset of 24 hours
$offset = 3600 * 24;
// calc the string in GMT not localtime and add the offset
$expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
//output the HTTP header
Header($expire);
header('Expires: 0'); header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: max-age=3600, must-revalidate');
header('Pragma: public'); header('Pragma: public');
header('Accept-Ranges: bytes'); header('Accept-Ranges: bytes');
header('Content-Length: '.OC_Filesystem::filesize($arguments['path'])); header('Content-Length: '.OC_Filesystem::filesize($arguments['path']));
$gmt_mtime = gmdate('D, d M Y H:i:s', OC_Filesystem::filemtime($arguments['path']) ) . ' GMT';
header("Last-Modified: " . $gmt_mtime );
OC_Filesystem::readfile($arguments['path']); OC_Filesystem::readfile($arguments['path']);
exit; exit;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment