Caching dynamic PHP pages

They have: 14 posts

Joined: Jan 2009

I have a PHP page that displays differently for each person viewing it. I want to be able to cache the HTML of the PHP page in the user's browser so that when they go back to that page, it will load the HTML version instead of running through all the PHP processes again.

The thing is, I want to be able to control whether or not the cached version will be displayed through $_GET variables appended to the URL. For example, if I went to www.mysite.com/page.php?cache=true, then it would display the cached version. If I went to www.mysite.com/page.php?cache=false, then it would run through all the PHP processes. How would I go about doing this?