This class can be used to capture and cache Web page content.
It can store cached content in files of a given directory. It uses an OS independent file locking to prevent that simultaneous attempts to update the cache files corrupt them.
First it checks whether the cache file exist and has not expired. In that case it retrieves the cache content into a class variable.
If the cache does not exist or has expired, the class can start capturing the output of the current script. When the script is done, the class can store the captured content in the cache file.