Hello,
To track site metrics I have an "image" in the html that loads a php page using a file string unique to this user's session: /stats.php?val1=x&val2=y&user=06e6e8b4790067aa9ef664ba565bcaa9. At the browser level I want to ensure this page is cached so the browser doesn't load this image more than once.
I've looked up php page caching, but all the articles are geared towards sending headers to ensure the page is NOT cached, the opposite of what I'm looking for:
header("Expires: Tue, 1 Jan 1980 12:00:00 GMT"); // Day in past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
I was able to rework only one header, Expires, setting that to a day in the far future. Are there any other headers I should rework or send?
header("Expires: Sat, 31 Dec 2050 12:00:00 GMT");