News Feed
Sections




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

DevShed:
Using HTTP Compression in PHP - Make Your Web Pages Load Faster
April 10, 2006 @ 15:26:56

One of the holy grails of web development is to have your pages lost the fastest way possible. People spend hours optimizing images and condensing the amount of data they actually send over the wire to reach this goal. There are, however, other ways to achieve some of the same results, HTTP compression being one of them. For those that aren't familiar with the topic, DevShed has this new article to bright you up to speed.

This article, the first of three parts, shows you how to make PHP pages load faster by showing you how to compress dynamic PHP pages. Techniques covered include using PHP's built-in "gzencode()" function, along with output buffering control functions.

Since PHP offers a powerful built-in library for handling HTTP compressed data, over this series I'll explain the basics of working with HTTP-compressed PHP pages. I'll illustrate, with several code samples, different methods for compressing dynamic PHP pages.

They start with the basics, writing up a simple script to compress the output from a simple PHP file, one that displays records from a "users" database. With that foundation laid, they move on to the heavy stuff - using more than just simple output buffering to speed up those pages. Their new example makes use of the gzip functions in PHP to compress the data even further. A gzip header is passed off to the browser and it pulls it all neatly compressed over to open on the client-side.

2 comments voice your opinion now!
compression http pages load faster gzip output buffering compression http pages load faster gzip output buffering


blog comments powered by Disqus

Similar Posts

Mike Bernat's Blog: Installing Xdebug - Best Decision You Will Ever Make

Mike Willbanks' Blog: Performance Tuning Overview

Josh Holmes' Blog: Making PHP faster on IIS

Smashing Magazine: Keeping Web Users Safe By Sanitizing Input Data

Chris Jones' Blog: Building PHP 5.3 with Oracle HTTP Server 11g


Community Events





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


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

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