News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder.com:
Caching Web Page Output for Server Optimization
August 24, 2006 @ 08:30:56

PHPBuilder.com has a few tricks up its sleeve when it comes to making your web pages as speedy as possible, and in their latest article, they've decided to share. It's part of an excerpt from the book "PHP 5 in Practice" from Eli White III and Jonathan Eisenhamer (Sams Publishing).

Often PHP is used to generate pages that do not change all that often. It isn't that PHP is used to make every page different for every user but that the page is simply built dynamically. In these situations, it is often the case that, the page really doesn't change all that often, perhaps only once a day, if that. In these cases, therefore, it is a waste of CPU time to regenerate the web page for every user.

In this situation, instead, we are going to create a dynamic solution. Some code that you can include at the top of every PHP file ensures that the page only gets generated once per hour for each script (see Listing 9.6.1).The function goes one step further and understands that different GET and POST parameters generate different pages and will therefore generate separate cached copies for each different combination of GET and POST parameters that occur.

They include a link to the source for the buffering and include an exmaple of its usage to get you started.

0 comments voice your opinion now!
caching web page output optimize server source example caching web page output optimize server source example


blog comments powered by Disqus

Similar Posts

Felix Geisendorfer's Blog: My new best friend - PHP's create_function()

Dave Dash's Blog: Dynamically adjusting your page title in symfony

Matthew Turland's Blog: Output Filters in Zend_View

Chris Chabot's Blog: phpSocketDaemon

MC|Press Online: TechTip: PHP Delivers mail() on IBM System i


Community Events





Don't see your event here?
Let us know!


symfony interview package version application framework install release language tool podcast voicesoftheelephpant introduction community composer security laravel opinion series library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework