Vector Posted November 23, 2009 Share Posted November 23, 2009 Hey, i'm glad to see that someone got this working. Any chance you could take a look at mine? I echoed apache_request_headers() and $_SERVER['HTTP_IF_MODIFIED_SINCE'], but the $_SERVER version is empty each time, and the apache_request_headers does not have the if-modified-since. I send these headers on the initial download, and if you click download again, there is no caching or last-modified. I also used tamper-data to watch the headers being sent (and received), and when the server is sending the headers, it is NOT sending the cache headers. I'm kind of desperate to get this working because i'm server VERY large image files, and mp3s, for a band who's on my servers, and fairly popular; which means that i'm about to get all of my bandwidth eaten.: $expires = 60*60*24*365; $size = filesize("{$client_directory}/{$_GET['did']}"); header("Content-Length: ".$size,true); header("Cache-Control: max-age={$expires}, public, no-transform",true); header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT',true); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-$expires) . ' GMT',true); header("Content-type: audio/example"); header("Content-Disposition: attachment; filename=\"{$_GET['did']}\""); readfile("{$client_directory}/{$_GET['did']}"); Any help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/182708-re-readfile-image-caching-on-client-side-split/ Share on other sites More sharing options...
Maq Posted November 23, 2009 Share Posted November 23, 2009 Hi Vector, Please do not resurrect old threads. This thread is more than a year old (November 07, 2008). If you would like to create a new thread with your question it would result in better feedback and we will be happy to help Quote Link to comment https://forums.phpfreaks.com/topic/182708-re-readfile-image-caching-on-client-side-split/#findComment-964268 Share on other sites More sharing options...
Vector Posted November 23, 2009 Author Share Posted November 23, 2009 So do you want me to delete this, or just go ahead and start a new topic? Quote Link to comment https://forums.phpfreaks.com/topic/182708-re-readfile-image-caching-on-client-side-split/#findComment-964271 Share on other sites More sharing options...
Daniel0 Posted November 23, 2009 Share Posted November 23, 2009 I've split this off. Please start separate topics for separate problems in the future. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/182708-re-readfile-image-caching-on-client-side-split/#findComment-964340 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.