Nolongerused3921 Posted February 7, 2007 Share Posted February 7, 2007 I'm curious as to the best way to force users to cache images that are downloaded with readfile? Currently I'm using: header("Pragma: public"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header("Content-Transfer-Encoding: binary"); header("Content-length: ".filesize($filethumb)); //header("Content-type: $file[mime]"); header("Content-Disposition: attachment; filename=$file[name]"); set_time_limit(0); @readfile($filethumb); To make sure they don't cache it... However I don't need this for thumbnails or downloading of files (The files will never change, as they can't be changed... You have to reupload a new ID inorder to change a file) Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 8, 2007 Author Share Posted February 8, 2007 Anyone? Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 9, 2007 Author Share Posted February 9, 2007 Anyone? Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 11, 2007 Author Share Posted February 11, 2007 Bump Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 12, 2007 Author Share Posted February 12, 2007 Bump Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 16, 2007 Author Share Posted February 16, 2007 Oh come on Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 16, 2007 Share Posted February 16, 2007 hold on, you want to cache the image? is that right? Quote Link to comment Share on other sites More sharing options...
Nolongerused3921 Posted February 16, 2007 Author Share Posted February 16, 2007 Yes I want the user to be forced to cache the image... I'm sucking up a lot of bandwidth by having it non-cacheable, and I realize my code is setup this way... However I can't just take these lines out as a lot of browsers don't cache dynamic images unless they're specifically told to... I want to know how to tell a browser to cache it regardless of the settings. Quote Link to comment 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.