Article Check
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Content Compression Using PHP

Tags

  • xhtml
  • about
  • checking
  • three benefits
  • directory project
  • compressing files

  • Links

  • Dell-Case Study in Corporate Self-destruction
  • Breast Cancer Treatments
  • Is IQ (Intelligence Quotient) The Product Of Inherited Knowledge And Acquired Knowledge?
  • Article Check - Content Compression Using PHP

    Search Engine Optimization 501- Why are Backlinks Important?
    After design of your web site and marketing your sites, you will want to use your social networks and search engine optimization tools to provide backlinks to your site. Backlinks are those incoming links to a website and/or web page. They provide you ways to keep track of other pages that link to yours.The number of backlinks one page has is a great way to see the popularity and importance of the information and
    you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinf

    Discount Shipping Supplies
    Shipping supplies are normally ordered in bulk. As a result, the manufacturers are often willing to give price discounts for those products that are purchased in bulk. Bulk-ordered shipping supplies include boxes, bags, tags, labels, and bubble wraps. Although there are several advantages to ordering shipping supplies in bulk, it is necessary to remember that safety is of utmost importance in the case of shipping supplie
    HTTP 1.0 introduced the idea of content encodings. A browser/client can notify the server that it can accept compressed content by sending the Accept-Encoding header. The Accept-Encoding header can be set as follows

    Accept-Encoding: gzip,deflate

    or with just one of gzip or deflate. You don't need to worry about any of this - PHP will automatically choose the correct compression to use.

    Compressing content usually results in less data being send across the network. This has three benefits:

    • Bandwidth usage decreases - you can serve more visitors before you reach your bandwidth limit
    • Network latency can be reduced because fewer packets will be used to transmit the data. Your application can appear faster to a user - page load times are reduced.
    • compressing files allows you to format your xhtml code for readibility without sacrificing page load times.

    There are two methods to using compression in PHP:

    Using zlib.output_compression
    Your PHP needs to be built with the zlib extension. In your php.ini file set

    zlib.output_compression = On

    to enable compression. You also need to make sure zlib.output_handler is empty.

    You can change the level of compression by using

    zlib.output_compression_level = d

    where d is a digit from 1(minimal compression) to 9(maximum compression). The higher compression levels increase CPU usage, possibly without any significant reduction in content size. Probably best to use a midrange value like 5. Or you can test different values and compare the content compressions. whatsmyip.org/mod_gzip_test shows you the original and compressed content sizes for any page you submit. It also tells you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinf

    Whadda Jerk!
    If one does not understand a person, one tends to regard him as a fool. Carl Jung Sadly, public discourse today seems to have degenerated into warring parties spitting epithets at one another. With little inclination to see the other’s point of view, the parties are reduced to name calling, labeling and the simplification of complex issues. The only commonality is the shared belief t
    data being send across the network. This has three benefits:
    • Bandwidth usage decreases - you can serve more visitors before you reach your bandwidth limit
    • Network latency can be reduced because fewer packets will be used to transmit the data. Your application can appear faster to a user - page load times are reduced.
    • compressing files allows you to format your xhtml code for readibility without sacrificing page load times.

    There are two methods to using compression in PHP:

    Using zlib.output_compression
    Your PHP needs to be built with the zlib extension. In your php.ini file set

    zlib.output_compression = On

    to enable compression. You also need to make sure zlib.output_handler is empty.

    You can change the level of compression by using

    zlib.output_compression_level = d

    where d is a digit from 1(minimal compression) to 9(maximum compression). The higher compression levels increase CPU usage, possibly without any significant reduction in content size. Probably best to use a midrange value like 5. Or you can test different values and compare the content compressions. whatsmyip.org/mod_gzip_test shows you the original and compressed content sizes for any page you submit. It also tells you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinf

    The Open Directory Project - Your Key to Google's Heart
    Let’s start it simple: www.dmoz.orgNow, if I am lucky, you either didn’t click the link or you did but you came back here to read my article. Either way, you want to know why is the Open Directory Project so important for your website and Google.The Most Important Directory on the WebA short definition of the Open Directory Project (DMOZ) is: “the most important directory on the Web”. If you add “hum

    There are two methods to using compression in PHP:

    Using zlib.output_compression
    Your PHP needs to be built with the zlib extension. In your php.ini file set

    zlib.output_compression = On

    to enable compression. You also need to make sure zlib.output_handler is empty.

    You can change the level of compression by using

    zlib.output_compression_level = d

    where d is a digit from 1(minimal compression) to 9(maximum compression). The higher compression levels increase CPU usage, possibly without any significant reduction in content size. Probably best to use a midrange value like 5. Or you can test different values and compare the content compressions. whatsmyip.org/mod_gzip_test shows you the original and compressed content sizes for any page you submit. It also tells you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinf

    Submitting A Press Release Can Benefit Your Business
    A Press Release is a captive story that can be about a person, a business or organizational group that is submitted to the media. The distribution of a release can be targeted to media outlets in newspapers, TV, radio stations, magazines and global newswire networks. Like with any other form of marketing, a well-submitted press release will give added publicity and creditability to an individual or a business.Jour
    1(minimal compression) to 9(maximum compression). The higher compression levels increase CPU usage, possibly without any significant reduction in content size. Probably best to use a midrange value like 5. Or you can test different values and compare the content compressions. whatsmyip.org/mod_gzip_test shows you the original and compressed content sizes for any page you submit. It also tells you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinf

    Video Streaming Reaching Out To The On Demand Customer
    YouTube and MeTV understand that people want a creative way to express themselves. The anonymity provided by the web has allowed multiple thousands of wannabe stars to shine in low-resolution splendor.The success of these online video enterprises has encouraged others like Yahoo, AOL and a variety of other media outlets to begin streaming video for online consumption.Even children’s television is finding wa
    you if your content is compressed - good for checking if your settings are working.

    The PHP manual recommends using this method over the next method.

    Note: You can only enable zlib.output_compression in your php.ini file, even though the PHP documentation suggests otherwise.

    Using ob_start
    The disadvantage with zlib is you need access to the php.ini file, if zlib.output_compression is not already enabled (phpinfo() can show you if its enabled). Some ISPs do not give you access to the php.ini file.

    You can use PHP's output buffering to compress your pages. In your scripts, or on the page you want compressed, add the following line

    ob_start('ob_gzhandler');

    This should be at the very top of your scripts. It needs to be called before any content is send to the browser/client. If you have an include file that you use for all your pages, you might want to put this line at the top of that file.

    This will put all output in PHP's output buffer. At the end of the script, the function ob_gzhandler is called. This callback function determines the compression to use ('deflate' or 'gzip'), and compresses the content. The compressed content is then send to the browser/client.

    Conclusion
    You have seen two methods of compressing content using PHP with very little effort on your part. I have seen page sizes reduced by up to 68% using these methods. Not bad for one line of code!

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.caseupon.com/article/86509/caseupon-Content-Compression-Using-PHP.html">Content Compression Using PHP</a>

    BB link (for phorums):
    [url=http://www.caseupon.com/article/86509/caseupon-Content-Compression-Using-PHP.html]Content Compression Using PHP[/url]

    Related Articles:

    How To Effectively Delegate

    Increasing Scope of Hindi Language

    An Easy Way Not to Get Banned by Google

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com