questions about compressing web page downloads with Gzip

Discussion in 'HTML' started by Mike S, Sep 1, 2010.

  1. Mike S

    Mike S Guest

    I just read an article about speeding up web page downloads using
    compression:

    http://webdesign.about.com/od/speed/ht/website-compression.htm

    The article includes the url of a compression test site:

    http://www.gidnetwork.com/tools/gzip-test.php

    I work on several PHP sites that I could use this on if it's beneficial,
    but I thought I'd ask for suggestions here first. Does anyone have
    experience using this, and is there a down side? Are there more settings
    available than the article mentions, since the increasing levels of
    compression have decreasing returns is it possible to choose the level
    of compression you want?

    TIA,
    Mike
     
    Mike S, Sep 1, 2010
    #1
    1. Advertising

  2. Mike S

    id|e Guest

    On Wed, 01 Sep 2010 00:18:06 -0700, Mike S wrote in alt.html:

    > I just read an article about speeding up web page downloads using
    > compression:
    >
    > http://webdesign.about.com/od/speed/ht/website-compression.htm
    >
    > The article includes the url of a compression test site:
    >
    > http://www.gidnetwork.com/tools/gzip-test.php
    >
    > I work on several PHP sites that I could use this on if it's beneficial,
    > but I thought I'd ask for suggestions here first. Does anyone have
    > experience using this, and is there a down side? Are there more settings
    > available than the article mentions, since the increasing levels of
    > compression have decreasing returns is it possible to choose the level
    > of compression you want?
    >
    > TIA,
    > Mike


    http://www.whatsmyip.org/http_compression/phpgzip/
    ;) Easy stuff.
    Test it out.
    http://www.whatsmyip.org/http_compression/

    --
    Compiling personal knowledgebase.
    Start Job 9/1/2010 12:38:34 AM
    End Job 9/1/2010 12:38:37 AM
     
    id|e, Sep 1, 2010
    #2
    1. Advertising

  3. Mike S

    Mike S Guest

    On 9/1/2010 12:38 AM, id|e wrote:
    > On Wed, 01 Sep 2010 00:18:06 -0700, Mike S wrote in alt.html:
    >
    >> I just read an article about speeding up web page downloads using
    >> compression:
    >>
    >> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>
    >> The article includes the url of a compression test site:
    >>
    >> http://www.gidnetwork.com/tools/gzip-test.php
    >>
    >> I work on several PHP sites that I could use this on if it's beneficial,
    >> but I thought I'd ask for suggestions here first. Does anyone have
    >> experience using this, and is there a down side? Are there more settings
    >> available than the article mentions, since the increasing levels of
    >> compression have decreasing returns is it possible to choose the level
    >> of compression you want?
    >>
    >> TIA,
    >> Mike

    >
    > http://www.whatsmyip.org/http_compression/phpgzip/
    > ;) Easy stuff.
    > Test it out.
    > http://www.whatsmyip.org/http_compression/


    Great link, thanks! How easy is this!
    <? ob_start("ob_gzhandler"); ?>
     
    Mike S, Sep 1, 2010
    #3
  4. Mike S

    id|e Guest

    On Wed, 01 Sep 2010 01:57:00 -0700, Mike S wrote in alt.html:

    > On 9/1/2010 12:38 AM, id|e wrote:
    >> On Wed, 01 Sep 2010 00:18:06 -0700, Mike S wrote in alt.html:
    >>
    >>> I just read an article about speeding up web page downloads using
    >>> compression:
    >>>
    >>> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>>
    >>> The article includes the url of a compression test site:
    >>>
    >>> http://www.gidnetwork.com/tools/gzip-test.php
    >>>
    >>> I work on several PHP sites that I could use this on if it's beneficial,
    >>> but I thought I'd ask for suggestions here first. Does anyone have
    >>> experience using this, and is there a down side? Are there more settings
    >>> available than the article mentions, since the increasing levels of
    >>> compression have decreasing returns is it possible to choose the level
    >>> of compression you want?
    >>>
    >>> TIA,
    >>> Mike

    >>
    >> http://www.whatsmyip.org/http_compression/phpgzip/
    >> ;) Easy stuff.
    >> Test it out.
    >> http://www.whatsmyip.org/http_compression/

    >
    > Great link, thanks! How easy is this!
    > <? ob_start("ob_gzhandler"); ?>


    Can't beat the Easy Button ;)

    --
    Double parked on the corner of Null and Void.
     
    id|e, Sep 1, 2010
    #4
  5. Mike S

    Mike S Guest

    On 9/1/2010 11:54 AM, Ed Mullen wrote:
    > id|e wrote:
    >> On Wed, 01 Sep 2010 00:18:06 -0700, Mike S wrote in alt.html:
    >>
    >>> I just read an article about speeding up web page downloads using
    >>> compression:
    >>>
    >>> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>>
    >>> The article includes the url of a compression test site:
    >>>
    >>> http://www.gidnetwork.com/tools/gzip-test.php
    >>>
    >>> I work on several PHP sites that I could use this on if it's beneficial,
    >>> but I thought I'd ask for suggestions here first. Does anyone have
    >>> experience using this, and is there a down side? Are there more settings
    >>> available than the article mentions, since the increasing levels of
    >>> compression have decreasing returns is it possible to choose the level
    >>> of compression you want?
    >>>
    >>> TIA,
    >>> Mike

    >>
    >> http://www.whatsmyip.org/http_compression/phpgzip/
    >> ;) Easy stuff.
    >> Test it out.
    >> http://www.whatsmyip.org/http_compression/
    >>

    >
    > One thing to note: The php code must go above everything else in the php
    > document /including/ the DOCTYPE.
    >

    Thanks Ed,

    The author of whatsmyip.org made that clear. He also mentioned,

    "The advantages (of mod_deflate) are that you don't have to add more
    code to every page. Plus it will compress things like css and JavaScript
    and XML too. And "they" say that mod_deflate is slightly faster than
    compressing in php."

    Do you know of any modern browsers that have an issue with mod_deflate,
    if I can get the ISPs to enable it that is?

    Thanks,
    Mike
     
    Mike S, Sep 1, 2010
    #5
  6. Mike S

    rf Guest

    "Mike S" <> wrote in message
    news:i5kung$r7q$-september.org...
    >I just read an article about speeding up web page downloads using
    >compression:
    >
    > http://webdesign.about.com/od/speed/ht/website-compression.htm
    >
    > The article includes the url of a compression test site:
    >
    > http://www.gidnetwork.com/tools/gzip-test.php
    >
    > I work on several PHP sites that I could use this on if it's beneficial,


    Why do you think it might be beneficial?

    Let's look at http://www.gidnetwork.com/tools/gzip-test.php for example.

    There is 5KB of HTML on that page of which only 3K comes from gidnetwork.

    There is 12 KB of CSS.

    There is a massive 220KB of javascript, only 2KB comes from gidnetwork. The
    rest comes from all over the place, from sources that gidnetwork probably
    have no control.

    So, out of a total of 244KB of downloaded stuff gidnetwork can only compress
    19K. The rest is out of their control. If they can compress their 19K to a
    half they have saved 9.5KB out of a total of 244KB. A saving of 3.8%.

    And what is the overhead in time of sending that extra 9.5KB? My ISP
    downloads stuff to me, once the connection is made, at over 5 megabytes per
    second. That 9.5KB would take about an extra 4 milliseconds. But, it takes
    me at least 30 milliseconds to make a connection to a local web site. For a
    site that is in the US (which I assume gidnetwork is) it takes me at least
    300 milliseconds for the round trip. 4 milliseconds extra over and above 300
    milliseconds is not much.

    Is it really worth it?
     
    rf, Sep 2, 2010
    #6
  7. Mike S

    Neredbojias Guest

    On 01 Sep 2010, "rf" <> wrote:

    >
    > "Mike S" <> wrote in message
    > news:i5kung$r7q$-september.org...
    >>I just read an article about speeding up web page downloads using
    >>compression:
    >>
    >> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>
    >> The article includes the url of a compression test site:
    >>
    >> http://www.gidnetwork.com/tools/gzip-test.php
    >>
    >> I work on several PHP sites that I could use this on if it's
    >> beneficial,

    >
    > Why do you think it might be beneficial?
    >
    > Let's look at http://www.gidnetwork.com/tools/gzip-test.php for
    > example.
    >
    > There is 5KB of HTML on that page of which only 3K comes from
    > gidnetwork.
    >
    > There is 12 KB of CSS.
    >
    > There is a massive 220KB of javascript, only 2KB comes from
    > gidnetwork. The rest comes from all over the place, from sources that
    > gidnetwork probably have no control.
    >
    > So, out of a total of 244KB of downloaded stuff gidnetwork can only
    > compress 19K. The rest is out of their control. If they can compress
    > their 19K to a half they have saved 9.5KB out of a total of 244KB. A
    > saving of 3.8%.
    >
    > And what is the overhead in time of sending that extra 9.5KB? My ISP
    > downloads stuff to me, once the connection is made, at over 5
    > megabytes per second. That 9.5KB would take about an extra 4
    > milliseconds. But, it takes me at least 30 milliseconds to make a
    > connection to a local web site. For a site that is in the US (which I
    > assume gidnetwork is) it takes me at least 300 milliseconds for the
    > round trip. 4 milliseconds extra over and above 300 milliseconds is
    > not much.
    >
    > Is it really worth it?


    I tried the line on one of my existing pages. Compressed ~40k down to
    under 10k but there is roughly 25-30k loaded in remote css and js
    files. Anyway, the compressed file loaded slightly *slower* (-very
    slightly) than the other (which is an .html file and that might matter.
    I didn't bother comparing .php to .php because I'm not going to do it
    after seeing the test.) I suppose on a *very* slow connection there
    might be a positive benefit but that would be moot since it's a video
    page.

    --
    Neredbojias

    http://www.neredbojias.org/
    http://www.neredbojias.net/
     
    Neredbojias, Sep 2, 2010
    #7
  8. Mike S

    Mike S Guest

    On 9/1/2010 10:14 PM, Neredbojias wrote:
    > On 01 Sep 2010, "rf"<> wrote:
    >
    >>
    >> "Mike S"<> wrote in message
    >> news:i5kung$r7q$-september.org...
    >>> I just read an article about speeding up web page downloads using
    >>> compression:
    >>>
    >>> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>>
    >>> The article includes the url of a compression test site:
    >>>
    >>> http://www.gidnetwork.com/tools/gzip-test.php
    >>>
    >>> I work on several PHP sites that I could use this on if it's
    >>> beneficial,

    >>
    >> Why do you think it might be beneficial?
    >>
    >> Let's look at http://www.gidnetwork.com/tools/gzip-test.php for
    >> example.
    >>
    >> There is 5KB of HTML on that page of which only 3K comes from
    >> gidnetwork.
    >>
    >> There is 12 KB of CSS.
    >>
    >> There is a massive 220KB of javascript, only 2KB comes from
    >> gidnetwork. The rest comes from all over the place, from sources that
    >> gidnetwork probably have no control.
    >>
    >> So, out of a total of 244KB of downloaded stuff gidnetwork can only
    >> compress 19K. The rest is out of their control. If they can compress
    >> their 19K to a half they have saved 9.5KB out of a total of 244KB. A
    >> saving of 3.8%.
    >>
    >> And what is the overhead in time of sending that extra 9.5KB? My ISP
    >> downloads stuff to me, once the connection is made, at over 5
    >> megabytes per second. That 9.5KB would take about an extra 4
    >> milliseconds. But, it takes me at least 30 milliseconds to make a
    >> connection to a local web site. For a site that is in the US (which I
    >> assume gidnetwork is) it takes me at least 300 milliseconds for the
    >> round trip. 4 milliseconds extra over and above 300 milliseconds is
    >> not much.
    >>
    >> Is it really worth it?

    >
    > I tried the line on one of my existing pages. Compressed ~40k down to
    > under 10k but there is roughly 25-30k loaded in remote css and js
    > files. Anyway, the compressed file loaded slightly *slower* (-very
    > slightly) than the other (which is an .html file and that might matter.
    > I didn't bother comparing .php to .php because I'm not going to do it
    > after seeing the test.) I suppose on a *very* slow connection there
    > might be a positive benefit but that would be moot since it's a video
    > page.


    You and rf raise a good point. Maybe you missed the post where I quoted
    the author of whatsmyip.org, who mentioned,

    "The advantages (of mod_deflate) are that you don't have to add more
    code to every page. Plus it will compress things like css and JavaScript
    and XML too. And "they" say that mod_deflate is slightly faster than
    compressing in php."

    But not all ISP's let you enable mod_deflate, and I have web pages that
    contain a lot of text, that do download noticeably faster using
    ob_start("ob_gzhandler");

    But as you point out it's not appropriate to every situation.

    Mike
     
    Mike S, Sep 2, 2010
    #8
  9. Mike S

    Neredbojias Guest

    On 02 Sep 2010, Mike S <> wrote:

    > On 9/1/2010 10:14 PM, Neredbojias wrote:
    >> On 01 Sep 2010, "rf"<> wrote:
    >>
    >>>
    >>> "Mike S"<> wrote in message
    >>> news:i5kung$r7q$-september.org...
    >>>> I just read an article about speeding up web page downloads using
    >>>> compression:
    >>>>
    >>>> http://webdesign.about.com/od/speed/ht/website-compression.htm
    >>>>
    >>>> The article includes the url of a compression test site:
    >>>>
    >>>> http://www.gidnetwork.com/tools/gzip-test.php
    >>>>
    >>>> I work on several PHP sites that I could use this on if it's
    >>>> beneficial,
    >>>
    >>> Why do you think it might be beneficial?
    >>>
    >>> Let's look at http://www.gidnetwork.com/tools/gzip-test.php for
    >>> example.
    >>>
    >>> There is 5KB of HTML on that page of which only 3K comes from
    >>> gidnetwork.
    >>>
    >>> There is 12 KB of CSS.
    >>>
    >>> There is a massive 220KB of javascript, only 2KB comes from
    >>> gidnetwork. The rest comes from all over the place, from sources
    >>> that gidnetwork probably have no control.
    >>>
    >>> So, out of a total of 244KB of downloaded stuff gidnetwork can only
    >>> compress 19K. The rest is out of their control. If they can
    >>> compress their 19K to a half they have saved 9.5KB out of a total
    >>> of 244KB. A saving of 3.8%.
    >>>
    >>> And what is the overhead in time of sending that extra 9.5KB? My
    >>> ISP downloads stuff to me, once the connection is made, at over 5
    >>> megabytes per second. That 9.5KB would take about an extra 4
    >>> milliseconds. But, it takes me at least 30 milliseconds to make a
    >>> connection to a local web site. For a site that is in the US (which
    >>> I assume gidnetwork is) it takes me at least 300 milliseconds for
    >>> the round trip. 4 milliseconds extra over and above 300
    >>> milliseconds is not much.
    >>>
    >>> Is it really worth it?

    >>
    >> I tried the line on one of my existing pages. Compressed ~40k down
    >> to under 10k but there is roughly 25-30k loaded in remote css and js
    >> files. Anyway, the compressed file loaded slightly *slower* (-very
    >> slightly) than the other (which is an .html file and that might
    >> matter. I didn't bother comparing .php to .php because I'm not going
    >> to do it after seeing the test.) I suppose on a *very* slow
    >> connection there might be a positive benefit but that would be moot
    >> since it's a video page.

    >
    > You and rf raise a good point. Maybe you missed the post where I
    > quoted the author of whatsmyip.org, who mentioned,
    >
    > "The advantages (of mod_deflate) are that you don't have to add more
    > code to every page. Plus it will compress things like css and
    > JavaScript and XML too. And "they" say that mod_deflate is slightly
    > faster than compressing in php."
    >
    > But not all ISP's let you enable mod_deflate, and I have web pages
    > that contain a lot of text, that do download noticeably faster using
    > ob_start("ob_gzhandler");
    >
    > But as you point out it's not appropriate to every situation.


    Yes, I checked that on the server and mod_deflate is explicitly
    enabled. As you say, though, a really large text page (or several in a
    row) would probably show some speed improvement.

    --
    Neredbojias

    http://www.neredbojias.org/
    http://www.neredbojias.net/
     
    Neredbojias, Sep 2, 2010
    #9
  10. Mike S

    Dylan Parry Guest

    "rf" <> wrote:
    > Why do you think it might be beneficial?
    > ...
    > Is it really worth it?


    The only real benefit I see is that it could help reduce your own
    bandwidth costs as you'd be sending less data to the user from your
    server. Of course this is probably only worth it if you are using lots
    of bandwidth, yet processor usage isn't causing any issues.

    The benefit to the end user, i.e.. the visitor, is probably negligible
    or nonexistent, but there may be benefits to you personally as the site
    owner.

    As always, YMMV!

    --
    Dylan Parry
     
    Dylan Parry, Sep 2, 2010
    #10
  11. Neredbojias wrote:

    > I tried the line on one of my existing pages. Compressed ~40k down to
    > under 10k but there is roughly 25-30k loaded in remote css and js
    > files.


    You can compress those as well, either in your httpd.conf if you have
    control, or in an .htacess file:

    # Compress JS & CSS
    AddOutputFilterByType DEFLATE text/css text/javascript

    # Why not other text files
    AddOutputFilterByType DEFLATE text/html text/plain text/xml



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Sep 2, 2010
    #11
  12. Mike S

    Mike S Guest

    On 9/2/2010 6:16 AM, Jonathan N. Little wrote:
    > Neredbojias wrote:
    >
    >> I tried the line on one of my existing pages. Compressed ~40k down to
    >> under 10k but there is roughly 25-30k loaded in remote css and js
    >> files.

    >
    > You can compress those as well, either in your httpd.conf if you have
    > control, or in an .htacess file:
    >
    > # Compress JS & CSS
    > AddOutputFilterByType DEFLATE text/css text/javascript
    >
    > # Why not other text files
    > AddOutputFilterByType DEFLATE text/html text/plain text/xml


    Thanks for mentioning that!
     
    Mike S, Sep 2, 2010
    #12
  13. Mike S wrote:
    > On 9/2/2010 6:16 AM, Jonathan N. Little wrote:


    >> # Compress JS & CSS
    >> AddOutputFilterByType DEFLATE text/css text/javascript
    >>
    >> # Why not other text files
    >> AddOutputFilterByType DEFLATE text/html text/plain text/xml

    >
    > Thanks for mentioning that!
    >


    Depending on your sever setup for javascript you may also need:

    application/x-javascript

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Sep 3, 2010
    #13
  14. Mike S

    Mike S Guest

    On 9/2/2010 4:35 PM, Jonathan N. Little wrote:
    > Mike S wrote:
    >> On 9/2/2010 6:16 AM, Jonathan N. Little wrote:

    >
    >>> # Compress JS & CSS
    >>> AddOutputFilterByType DEFLATE text/css text/javascript
    >>>
    >>> # Why not other text files
    >>> AddOutputFilterByType DEFLATE text/html text/plain text/xml

    >>
    >> Thanks for mentioning that!
    >>

    >
    > Depending on your sever setup for javascript you may also need:
    >
    > application/x-javascript


    Thanks very much Johnathan, this is good to know.
     
    Mike S, Sep 3, 2010
    #14
  15. Mike S

    Neredbojias Guest

    On 02 Sep 2010, "Jonathan N. Little" <> wrote:

    > Neredbojias wrote:
    >
    >> I tried the line on one of my existing pages. Compressed ~40k down
    >> to under 10k but there is roughly 25-30k loaded in remote css and js
    >> files.

    >
    > You can compress those as well, either in your httpd.conf if you have
    > control, or in an .htacess file:
    >
    > # Compress JS & CSS
    > AddOutputFilterByType DEFLATE text/css text/javascript
    >
    > # Why not other text files
    > AddOutputFilterByType DEFLATE text/html text/plain text/xml


    I'll have to try that.

    --
    Neredbojias

    http://www.neredbojias.org/
    http://www.neredbojias.net/
     
    Neredbojias, Sep 3, 2010
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news
    Replies:
    2
    Views:
    1,093
  2. =?Utf-8?B?U2hlcg==?=

    Compressing and spanning files on upload

    =?Utf-8?B?U2hlcg==?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    485
    =?Utf-8?B?U2hlcg==?=
    Dec 28, 2005
  3. Jobs
    Replies:
    1
    Views:
    571
    Alvin Bruney [MVP]
    Aug 29, 2007
  4. Chris Kennedy
    Replies:
    1
    Views:
    353
    Gregory A. Beamer
    Jul 19, 2009
  5. mtv

    Compressing entire ASP.NET or WebService page

    mtv, Dec 9, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    124
    Arthur Nesterovsky
    Dec 14, 2004
Loading...

Share This Page