How can I remove all http-headers - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How can I remove all http-headers (/showthread.php?tid=69531) |
How can I remove all http-headers - temi - 12-10-2017 Hi all, I just want to remove all headers that php will add no Set-Cookie, Pragma, Cache-Control. Because this headers prevent my cache (nginx fastcgi cache) from caching. I know I can use fastcgi_ignore_headers but I think it's better php controls the cache. Thank you temi RE: How can I remove all http-headers - temi - 12-10-2017 ok I have my solution I just set the right headers in the controller $this->output->set_header('Cache-Control: public'); $this->output->set_header('Pragma: cache'); $this->output->set_header('Expires: ' . gmdate( 'D, d M Y H:i', time() + 120 ) . ' GMT'); and in nginx fastcgi_ignore_headers Set-Cookie; now php controls the cache fastcgi and browser or public caches Thank you (for CI and all the free stuff) temi |