So, your web site is starting to get popular? With popularity comes more page request, and with more page requests comes higher server load. Don't get in a situation where you can't serve up the pages. Build your application to handle the load. That's where PEAR::Cache comes in. In this tutorial, Timothy will show you how to use it.
A PHP script must be compiled and processed by the Zend engine regardless if its results are the same each time it's called. The server needs to work harder to generate and display the requested page as your PHP applications become more complex. As your web site attracts more visitors, the server works harder more often. The server's performance may eventually begin to degrade.
If it's known that the output will be the same each time a script will be run, there's no need for the server to reprocess it. The load on the server can be reduced if the output of such scripts are stored and returned later for matching requests. This storing is known as "caching."
Caching is not a new idea; caching exists in web browsers, proxy servers and other special applications. In PHP, we can reap the benefits of caching output in our scripts by using Pear::Cache.