Here is a quick code snippet which will allow you to easily cache pages in PHP.