How to force browsers to cache media (Using PHP)?


I have a media streaming URL with the following php codes at the end:

header("Content-type: audio/mpeg");

header('Content-Length: '.filesize($rlu)); // provide file size

header("Expires: -1");

header("Cache-Control: no-store, no-cache, must-revalidate");

header("Cache-Control: post-check=0, pre-check=0", false);


If i remove the lines:


Is it enough to tell all browsers to cache my media data?

Thanks in advance :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.