News Feed
Jobs Feed
Sections




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

Alison Lunde's Blog:
Quick and Dirty PHP Caching
March 30, 2009 @ 12:56:32

Alison has posted a guide to a technique that can help your site resist higher loads - content caching:

Caching your database-driven website pages has a plethora of benefits, not the least of which being improved speed and reduced server loads. This article will explain how to set up a simple caching system, and will also address when and where caching might not be appropriate.

She shares her "six lines of glory" that cache the resulting HTML page (after all data has been pulled from the database and rendered) into a cached file with output buffering. On other side of things, there's another script that, based on the page requested, checks to see if a cached file exists. She also modifies it slightly to include a timestamp so things aren't just cached forever.

There's also a recommendation in the comments of the post to use the APC caching extension that's already built. Of course, this can only really be used if you have access to install it on the remote machine (not an option on things like shared hosting).

0 comments voice your opinion now!
caching file apc example tutorial script extension timeout


blog comments powered by Disqus

Similar Posts

SitePoint.com: Be More Asssertive: Getting to Know PHPUnit's Assertions

Christian Weiske's Blog: First work on the Generic PHP Application Installer

Chance Garcia's Blog: TEKX Tutorials - Best Practices & Being the Bad Guy

IBM developerWorks: Java and PHP technology on AIX - Integrate the Java business application w/ DB2

MelonFire Community: Caching Web Sites With PEAR Cache


Community Events











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


symfony2 security hhvm install series unittest package podcast database introduction opinion application framework component performance hack composer facebook release language

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