php - How to cache script image -
i want implement script generates thumbnail on requested file (image). here simple list of actions understand working of script: request server url/preset/filename.jpg check if file thumbed if not, generate new 1 , return file. if exists return thumbed file. this works perfect, problem images not cached browser. i'm not familiar caching. thought returning 304 not modified trigger browser image cache hangs in pending state. does know how cache these images? this show part of script: private function _show_image($file_path, $filename, $new = false) { $this->load->helper('file'); if($new) { header($_server['server_protocol'] . ' 200 ok'); } else { //header('http/1.1 304 not modified'); header($_server['server_protocol'] . ' 304 not modified'); } header('cache-control: public'); // needed i.e. header('content-type: