My web project is based on XSLT created XHTML pages which takes some time to be created. On the other side, the original XML changes rarely. Therefore, I set a browser cache with a HTTP header in PHP:
header("Cache-Control: public, max-age=3600");
Going "back" and "forward" in the browser is now very smooth.
But there is another case: By clicking on some links the user could possibly get the very same page again. The URL is also exactly the same. But in this case the page isn't loaded from the browser cache, but created anew. I've found a very nice solution for a server cache on http://www.webgeekly.com/tutorials/php/learn-how-to-cache-content-with-php-in-under-5-minutes/ . But retrieving the file from the browser cache would even be faster.
So, is there a way in PHP to do this:
- check whether a certain URL part (like "output.php?id_of_search=123454&action=select") is in the browser cache
- if yes: Load the page with that URL from the browser cache.
Thanks in advance!