Server-Side Caching for Dynamic Content

Hello,

I have the following code, where the output_buffer is started, and then a script is executed. The file that this code is contained in is - file: cachingSystem/server.php.

It is included in the header of all the PHP files worth caching.

<?php
ob_start();
include_once($_SERVER[“SCRIPT_FILENAME”]); // What should go here? Is this correct for displaying the outcome?
$contents = ob_end_clean(); // What should go here? Is this correct for displaying the outcome?

$md5DUB = @md5($contents);
$md5sum = @file_get_contents($filex); // WHERE $filex contains the already pre-recorded MD5 SUM.

if($md5DUB == $md5sum){ # All the rest of my code goes here # }

?>

My question is this. I am including the file where this code is, into the header of the index.php file that I am trying to include in the code.

Will that effect the MD5 SUM that is calculated?

I hope I am not confusing anyone; help is appreciated :slight_smile:

The MD5 sum that keeps appearing is the empty / null MD5 of d41d8cd98f00b204e9800998ecf8427e.

I need a way to tell what the MD5 sum of the content on the page that is being requested is through a prepended file at the top.

Thanks everyone!