alwoodman Posted May 18, 2010 Share Posted May 18, 2010 Hi I have a simple page cacher on my site <?php if($_GET['testing'] != 1){ $cachefile = 'cache/index.html'; $cachetime = 3000; // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { include($cachefile); exit; } ob_start(); } ?> but recently came across this update to it which is: <?php if($_GET['testing'] != 1){ $cachefile = 'cache/index.html'; $cachetime = 3000; // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { include($cachefile); exit; } if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); } ?> Could you confirm this script is caching the content of my page and when a user requests it again it's being decompressed? The reason i ask is the output still seems to be the same size in the cache folder with and without this code thanks Lee Link to comment https://forums.phpfreaks.com/topic/202156-page-caching-and-compression/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.