Re: Media file browser cache question --- second try
| From: | Marek Kilimajer | Date: | Mon, 20 Sep 2004 09:56:08 +0000 |
| Subject: | Re: Media file browser cache question --- second try | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197256@lists.php.net to get a copy of this message | ||
Daniel Guerrier wrote:
I'm using this code to dynamically retrieve windows media files and send it to the browser. I thought the cache header would prevent the file from being cached. The only problems is the .wmv file still ends up in my IE temp files folder. How can I prevent this from happening?The headers have influence on the asx file, .wmv files are served by the webserver (no php involved) and the webserver doesn't send no-cache headers. You need to either: 1. Configure webserver to send the right headers for .wmv files. 2. Use php to send .wmv files, you can then send the headers from php
------------------------------------
<?php
require_once("../admin/constant.php");
header("Content-Type: video/x-ms-wmv");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") .
" GMT");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache,
must-revalidate"); header("Cache-Control: post-check=0, pre-check=0",
false);
header("Pragma: no-cache");
$file = DATAURL . "/media/" . $_GET['mediafile'];
?>
<ASX VERSION="3.0">
<ENTRY>
<REF HREF ="<?php echo $file; ?>" />
</ENTRY>
</ASX>