PHP
  Home arrow PHP arrow Caching Result Sets in PHP: A Content...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Caching Result Sets in PHP: A Content-Change Triggered Caching System
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2005-10-12

    Table of Contents:
  • Caching Result Sets in PHP: A Content-Change Triggered Caching System
  • Back to the origins: a quick overview of the time expiry based caching script
  • Another caching strategy: building a content-change triggered caching system
  • Wrapping the code: defining the “readData()” and “readQueryResult()” functions
  • Gluing the pieces together: listing the whole source code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Caching Result Sets in PHP: A Content-Change Triggered Caching System


    (Page 1 of 5 )

    Caching within the context of PHP application acceleration can be triggered based on three possible categories: time expiry, content change, and manually. This article covers an application that triggers the caching mechanism based on a content change condition.

    Introduction

    Welcome to the second part of the series “Caching result sets in PHP.” Over the first part of the series, we discussed the benefits of having a result set caching system working on the backend, as an efficient mechanism to reduce the overhead caused to the server, particularly when it’s serving many requests from a database-driven application.

    Indeed, the result set caching approximation presents some significant advantages over (X)HTML output caching, since it allows for performing some kind of post processing on the cached data, due to the inherent advantage of having the data completely isolated from the (X)HTML structure. This method differs significantly from the conventional “entire-output” caching, which offers a minor level of flexibility.

    As with many issues within the context of PHP application acceleration, caching offers a wide range of implementations. Whatever caching system will be applied, its triggering mechanism is mostly based on three possible categories:

    • Time expiry based caching triggering
    • Content change based caching triggering
    • Manually based caching triggering

    Of course, an application might use either one of these caching triggers, or a combination of them, because of the flexibility that result set caching brings to developers.

    Stepping back to the first part of the series, we’ve looked at a caching script that falls under the first category, that is, triggered by a time expiry condition (usually specified in seconds), thereby forcing a new cache generation each time this condition is met.

    Due mainly to the flexible nature of the generated source code, in this second part, we’ll take a look at an application that triggers the caching mechanism based on a content change condition, without modifying its core logic.

    So, it looks like we need to write a bit more code. Let’s do it together. 

    More PHP Articles
    More By Alejandro Gervasio


       · In this second part of the series, the process for result-set caching is focused on...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT