15 methods to speed up PHP based website’s performance

Posted: February 4, 2010 in Technology

PHP is great for writing quick dynamic stuff for your website. Just a couple of lines of code can be written in 2 mins to insert or retrieve data from db. But with ease there is also some pain… the downside is that each request for a dynamic page can trigger multiple db queries, processing of output, and finally formatting to display on browser. This process can eventually be slow on larger sites or slower servers.

In this article, we’ve put together the list of caching plugins and techniques which can be used to improve your website performance.

  1. Caching output in PHP – Caching of output in PHP is made easier by the use of the output buffering functions built in to PHP 4 and above.
  2. PHP Caching to Speed up Dynamically Generated Sites – Instead of regenerating the page every time, the scripts running this site generate it the first time they’re asked to, then store a copy of what they send back to your browser. The next time a visitor requests the same page, the script will know it’d already generated one recently, and simply send that to the browser without all the hassle of re-running database queries or searches.
  3. Alternative PHP Cache – A free and open opcode cache for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.
  4. PHP-Cache-Kit – Dramatically speed up your site with this easy-to-use PHP caching kit. A slim little PHP class which allow you to quickly and easily implement module-level caching into your PHP projects.
  5. Unearth PHP Cache Engine – A flexible, easy-to-use system for caching PHP pages. It is really intended to cache a series of parts of a single page independently, each with its own refresh requirements. Caching of this sort can dramatically decrease page rendering time.
  6. PHP Cache Class – A PHP class that caches output generated by PHP files and uses the cached version instead of generating the content again and again. Cache files expire after a specified amount of time.
  7. PHP Accelerator – A plugin PHP Zend engine extension that provides a PHP script cache and is capable of delivering a substantial acceleration of PHP scripts without requiring any script changes, loss of dynamic content, or other application compromises.
  8. gCache – A PHP class that can be used to capture and cache Web page content. It can store cached content in files of a given directory.
  9. Skycache – A free, lightweight, and fast page cache for PHP 4 and PHP 5. Once a dynamic page has been computed, it is stored in a page cache. If a query for the same URL is made afterwards, the content is immediately served from the cache instead of processing the script again. The end result is a significant speedup and a slightly reduced server load.
  10. eAccelerator – A further development of the mmcache PHP accelerator and encoder. It increases the performance of PHP scripts by caching them in a compiled state, so that the overhead of compiling is almost completely eliminated.
  11. PHP FastFileCache – Caches output from dynamic PHP scripts, and stores them in files for fast retrieval under high server load. It supports a global timeout setting for maximum cache age, as well as per-file timeout overrides. It also implements file locking, to prevent data corruption and unnecessary processing.
  12. CacheIt – A PHP class designed to facilitate caching.
  13. Turck MMCache for PHP – A free PHP accelerator, optimizer, encoder, and dynamic content cache. It increases performance of PHP scripts by caching them in a compiled state, so that the overhead of compiling is almost completely eliminated.
  14. TinyButStrong – A template class for PHP that allows you to generate HTML pages using MySQL, PostgreSQL, SQLite in native, and any other databases.
  15. Boost website performance in 5 seconds! – Not exactly caching but simple enough to implement a quick fix.

Did we miss something? Please let us know in the comment area.

About these ads
Comments
  1. EllisGL says:

    15? I see three.
    1. Output Buffering
    2. Page level caching
    3. OpCode caching

    TBS is a template engine…

    Also the links are not working.

  2. dörte says:

    Please rename the Topic to 15 links for caching systems.

  3. waro says:

    Good list. But I also would like a list for someone who doesn’t have access to server as root or websites in shared hosting.

  4. caefer says:

    I’m actually a bit shocked by this list. All the teams I supported so far have gotten this one simple advice first: DO NOT NEVER EVER THINK ABOUT CACHING!
    Most of the time if you experience performance problems they come from bad code, bad design, connectivity to other systems such as the database, bad queries, you get the point.
    Solving these with caching only means that you increase the complexity of your project as you probably have to think about cache invalidation, cache warming, etc..

    The only cache that I advise on using right away is an opcode cache like APC. That will in most cases just work. But all the others you should avoid until you have no other option to improve. And then use with great caution.

    • Chris Henry says:

      Cache invalidation is certainly a huge problem to tackle, but then so is scaling, and so is getting your page to user as fast as possible. Databases simply aren’t as fast as pulling information from memory, particularly complex, hard to get pieces of information. The work necessary to get a database server (read: MySQL) or group of servers thereof to service the number of requests a small memcached pool can is astronomical, incredibly complex, and requires specialized knowledge. When dealing with caching and cache invalidation, all you need to know is when the cache needs to change.

  5. Drejk says:

    Good article but where are the links for these cache systems? Why are the names underlined if there is no link? This seems amateurish.

  6. iphoneman says:

    thanks. good article.

  7. pioneear says:

    Most of these alternatives are now out of date. Would be good if they were maintained better.

  8. hello!,I love your writing so so much! percentage we keep up a correspondence more approximately your post on AOL? I require a specialist in this space to resolve my problem. Maybe that is you! Having a look forward to peer you.

  9. Exactly where did u acquire the ideas to create ““15 methods to speed up PHP based website’s performance Arun Gandhi”?
    Thanks for the post ,Violet

  10. Hi I am so thrilled I found your website,
    I really found you by mistake, while I was searching
    on Aol for something else, Nonetheless I am here now and would
    just like to say thanks a lot for a fantastic
    post and a all round entertaining blog (I also love the theme/design), I
    don’t have time to read through it all at the moment but I have saved it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the awesome work.

  11. itgenesys says:

    I do not agree with any of them… very poor explanation .

    let me know if you need any more help ……

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s