|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-24 20:18 UTC] srinatar@php.net
[2009-11-24 21:59 UTC] vector dot thorn at gmail dot com
[2009-11-25 07:25 UTC] jani@php.net
[2009-11-25 07:28 UTC] carsten_sttgt at gmx dot de
[2009-11-25 09:17 UTC] jani@php.net
[2009-11-25 16:02 UTC] vector dot thorn at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
Description: ------------ If this section is in your httpd.conf: <FilesMatch "\.(php)$"> Header unset Cache-Control Header unset Expires Header unset Last-Modified FileETag None Header unset Pragma </FilesMatch> Then the cache headers here will not be used: $expires = 60*60*24*365; $size = filesize("{$client_directory}/{$_GET['did']}"); $last = filemtime("{$client_directory}/{$_GET['did']}"); header("Content-Length: ".$size,true); header("Etag: ".md5($last),true); header("Server: Ionisis.com",false); header("Cache-Control: max-age={$expires}, public,no-transform",true); header('Expires: ' . gmdate('D, d M Y H:i:s',($last+$expires)) . ' GMT',true); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last) . ' GMT',true); header("Content-type: audio/example"); header("Content-Disposition: attachment; filename=\"{$_GET['did']}\""); readfile("{$client_directory}/{$_GET['did']}"); and even if you remove that section, and these headers are sent, the client is still not sending a "if-modified-since" header that can be captured at the server level for the php level. Firefox 3.5, Apache 2.2, PHP 5.3, Fedora Linux Reproduce code: --------------- Just copy that code, and paste it in an file called download.php, and set it up so that it grabs an mp3 file, then beat your head into the desk for 2 days :D Expected result: ---------------- I expected it to send the proper cache headers, despite what the server was preconfigured to send. Actual result: -------------- Had to remove the server's configuration section pertaining to caching php output.