Code evaluation (pull file from browser cache)
$30-250 USD
Paid on delivery
10 hour assignment.
I am using a code to pull the cached files from the browser (primarily Internet Explorer). It's not working properly. I Want to see if anybody can get it working.
The file is supposed to look at the temp folder for a specific file then use "output buffering" so that I may use the saved version of the file or use the cached file as a variable in my other php code
here is the code:
// check if the cache file already exists
// and is less than 5 minutes old
if (file_exists(’[url removed, login to view]’)
&& time() - filemtime(’[url removed, login to view]’) < 300) {
// the output is already cached, so just
// dump the file’s contents to the browser
readfile(’[url removed, login to view]’);
} else {
// otherwise, the cache doesn’t exist yet
// or is more than 5 minutes old, so it’s time
// to re-generate the content
// turn on output buffering so your code’s output
// gets stored in the buffer instead of sent to the
// browser
ob_start();
// here you can place the existing PHP and HTML
// you want to cache
// now, write the output you captured in the buffer
// into the cache file
$fp = fopen(’[url removed, login to view]’, ‘w’);
fwrite($fp, ob_get_contents());
fclose($fp);
// and output the buffer’s contents to the
// browser as well
ob_end_flush();
Project ID: #322536