PHP
  Home arrow PHP arrow An Object-based Approach to HTTP Compr...
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

An Object-based Approach to HTTP Compression in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2006-04-17

    Table of Contents:
  • An Object-based Approach to HTTP Compression in PHP
  • Object-based "Gzip" compression: creating a data compressor PHP class
  • Setting up a concrete example: putting the "DataCompressor" class to work
  • Explaining the example

  • 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


    An Object-based Approach to HTTP Compression in PHP


    (Page 1 of 4 )

    Welcome to the second tutorial of the series “Using HTTP compression in PHP.” In three parts, this series demonstrates how to apply HTTP compression to parsed PHP pages, in order to reduce their overall download times, which results in faster delivery of dynamic content.

    Introduction

    Over the first tutorial of this series, I developed some hands-on examples, aimed at illustrating how "Gzip" encoding can be used within PHP scripts to compress the output generated by dynamic PHP pages. After transferring the encoded data to the client, contents are uncompressed and finally displayed on the browser.

    As you probably recall, the data encoding/decoding process that I just described  was performed by a combination of the PHP built-in "gzencode()" function and some output buffering functions. These became extremely handy for storing temporarily the dynamic output of parsed PHP files and applying "Gzip" encoding on the respective data. Indeed, output buffering control can be used as a simple mechanism for implementing different kinds of post-processing on parsed data, such as caching (X)HTML output, or compressing dynamic pages, to name a few popular applications.

    Now that the data compression methods shown in the previous article are hopefully familiar concepts to you, it's time to move toward the implementation of HTTP compression within object-oriented PHP applications, particularly, for obvious reasons, on those whose output include some sort of (X)HTML rendering process.

    By the end of this article, you should have the appropriate knowledge for building a simple data compressor class, in addition to using HTTP compression for reducing the download time of object-generated web pages. I'm sure the subject is quite interesting to you, so let's dive into the topic together.

    More PHP Articles
    More By Alejandro Gervasio


       · In this second tutorial of the series, HTTP compression is implemented by using a...
     

       

    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