I want to cache ever x minutes my homepage because it has many requests and the content doesn't change that often,
This is what I'm trying:
<?php
ini_set('error_reporting', 1);
error_reporting(E_ALL);
$path = '/home/......../mypath/html/';
if(true){
$homePage = file_get_contents($path.'index.php');
file_put_contents('indexx.html', $homePage);
//echo $homePage;
}
?>
The problem is that instead of getting the html result code it returns the php code (i am pretty sourprised about this.....)
Any idea why? and how to get the rendered version instead?
thanks