Hey guys,
I've seem to forgotten how to cache a php page so that when the a link is clicked the dynamic content is only grabbed from the DB only once a day.
every Google results point to /not/ caching.
I've got caching enabled so that now my back/forward browser button do not regenerate the page.
FYI: It's a report that takes a long time to regenerate.
Other pages on my site, the search and filter pages, those should not cache anything, so whatever solution, it must apply to specific pages.
Code:
Besides saving the output buffer to a file, is there any other way to force PHP/FF Browser to keep the same output.
Thanks,
Dan
I've seem to forgotten how to cache a php page so that when the a link is clicked the dynamic content is only grabbed from the DB only once a day.
every Google results point to /not/ caching.
I've got caching enabled so that now my back/forward browser button do not regenerate the page.
FYI: It's a report that takes a long time to regenerate.
Other pages on my site, the search and filter pages, those should not cache anything, so whatever solution, it must apply to specific pages.
Code:
Code:
$secondsToMidnight = (strtotime('midnight')+86400)-time();
header("Pragma: public");
header("Cache-Control: maxage=$secondsToMidnight"); // HTTP/1.1
header("Expires: " . date('r',time()+$secondsToMidnight)); // Date in the past
Thanks,
Dan
Comment