romansvoboda Posted October 22, 2013 Share Posted October 22, 2013 (edited) I have PS 1.5.4.0. Compression is turned on and works for css and js for, but does not work for the source code of the page. This means that compression is not working for php. When I look at the results of some instruments (Webpagetest or PageSpeedInsight), compression for php is not, it is seen in the attached pictures. Can anyone advise me? Edited October 22, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
itdes Posted October 22, 2013 Share Posted October 22, 2013 (edited) Hello, What helped me when facing the same issue was adding this line of code: if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); in the beginning of 'index.php' file, the one in the main PrestaShop directory, just before the line: require(dirname(__FILE__).'/config/config.inc.php'); Edited October 22, 2013 by itdes (see edit history) 2 Link to comment Share on other sites More sharing options...
romansvoboda Posted October 22, 2013 Author Share Posted October 22, 2013 Well done! It works ... so simple. Thanks a lot Link to comment Share on other sites More sharing options...
itdes Posted October 22, 2013 Share Posted October 22, 2013 You're welcome. I'm glad I could help. Regards. Link to comment Share on other sites More sharing options...
vekia Posted October 22, 2013 Share Posted October 22, 2013 thank you for the solution itdes im going to mark this topic as [solved] for me this code is very helpful mainly because i've got similar problem with regards, Milos 1 Link to comment Share on other sites More sharing options...
Recommended Posts