Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
scoop and mod_gzip Announcements
By Smirks , Section News []
Posted on Wed Nov 07, 2001 at 12:00:00 PM PST
Over the last few days I've been experimenting with using the apache mod_gzip module with my scoop installation. I was fianlly able to put together a working setup which reduces the page size by as much as 85 percent!

You can have a working scoop/mod_gzip installation by following these steps:

  1. Grab the mod_gzip apache module from mod_gzip website
    • You can either compile the module into apache directly, or you can use the loadable module
  2. Add the following to your httpd.conf file:
    mod_gzip_on yes
    mod_gzip_dechunk yes
    mod_gzip_keep_workfiles No
    mod_gzip_temp_dir /tmp
    mod_gzip_minimum_file_size 1002
    mod_gzip_maximum_file_size 0
    mod_gzip_maximum_inmem_size 1000000
    mod_gzip_item_include mime text/html
    mod_gzip_item_include mime text/plain
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime text/.*
    mod_gzip_item_include mime application/x-httpd-cgi
    mod_gzip_item_include handler ^perl-script$
    mod_gzip_item_exclude file "\.css$"
  3. Restart apache
  4. Watch how the pages load faster!
On my scoop site I noticed the index page going from nearly 50k to just over 8k! Feel free to look at my mod_gzip statistics for InTune, where you can see how much of the actual data is being compressed with neat little graphs produced by mgstat.
< Sumballo | Valid HTML? >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· mod_gzip website
· scoop site
· statistics
· mgstat
· More on Announcements
· Also by Smirks

Story Views
  130 Scoop users have viewed this story.

Display: Sort:
scoop and mod_gzip | 16 comments (16 topical, 0 hidden)
Other download size issues. (none / 0) (#1)
by Jacques Chester on Thu Nov 08, 2001 at 07:24:36 PM PST

Firstly, a good CSS implementation would allow the browser one CSS file for the entire site. There's kilos of redundant formatting right there.

Secondly, the server should aggressively strip out unnecessary whitespace, comments and whathaveyou. Turn it into a few long lines. In my experience this shaves off about 10-20% of any HTML document.

These things aren't just for speed - I pay per-MB. Halving my incoming traffic from K5 could chop my bill by maybe 15%.
-- "Hell, even I don't know what I'll do next!" -- His Imperial Dynarchic Majesty Random II.



THANK YOU (none / 0) (#2)
by slinberg on Fri Nov 09, 2001 at 10:31:45 AM PST

THANKS for posting this! I had no idea this was possible. I installed it on my server and it was simple - even recompiling was a snap with apxs (do an apachectl configtest before restarting, mine warned that the precompiled binary wouldn't work), and then turning it on was simple.

It's amazing how much faster my sites feel now.

Thanks for sharing this.



more processing? (none / 0) (#6)
by janra on Sun Nov 11, 2001 at 12:20:09 AM PST

I would love to have my pages load faster, but doesn't using mod_gzip increase the processing the server has to do before sending out the page?

Basically, I know you got much faster response, but would I? I get a lot of people hitting 'stop' before the page starts loading as it is (at least, I'm assuming that's what 200 0 for http response code and bytes sent, respectively, means).

I know, I know, get a faster computer, right? ;)


--
Discuss the art and craft of writing




Wow (none / 0) (#9)
by kcidx on Tue Nov 13, 2001 at 10:29:54 AM PST

I just installed this on my 400mhz Athlon w/ 320MB of ram and all I can say is WOW!

I can't remember the last time I had such an intense performance gain from such a relatively small modification.

It's especially noticable because my site has a relatively small and regular amount of traffic, but it's hosted on a cable modem that frequently lags really really bad...hence any decrease in the amount of data transmitted transforms into a very noticeable increase in performance.

Thanks for the tip! It's great!



Stats (none / 0) (#11)
by fluffy grue on Mon Dec 03, 2001 at 11:54:55 PM PST

I think something's wrong with your stats... it's giving about the same numbers for both 'all objects' and 'compressable objects' even though compressable objects should be about 30% as much.
--
(λq.qq)(λq.qq)


Key point! (none / 0) (#13)
by rusty on Fri Jan 25, 2002 at 03:21:32 PM PST

I set this up on K5, and was underwhelmed. It didn't seem to be working right or something. Then just today, someone finally clued me in. This is important:

If you're running Scoop with a two-server mod_perl/proxy configuration, you need the following line in your config:

mod_gzip_item_include handler ^proxy-server$

Otherwise, mod_gzip won't know it's supposed to hanbdle pags that come out of the proxy, so none of your Scoop pages will get compressed.

This is now on K5, and compressing by ~80%. It's very nice. :-)



Uhh... (none / 0) (#14)
by fsterman on Tue Apr 08, 2003 at 01:28:07 PM PST

After a cursory look at mod_gzip I think you need to tweek your settings a bit. Since images have already got really good compression you need to add the line:

mod_gzip_item_exclude         mime       ^image/

Netscape 4.x has problems with CSS & Java Script so you need to either delete the line "mod_gzip_item_exclude file "\.css$"" and include the line "mod_gzip_item_exclude         file       \.js$" _or_ just exclude NS 4 from getting compressed material.  "mod_gzip_item_exclude         reqheader  "User-agent: Mozilla/4.0[678]""
As Jacques Chester said if you just do a global CSS it is probably best to do the first solution.
mod_deflate is also more flexable with more powerful filters.  Giving the ability to compress everything that a browser can handle but compress that wich it can't.  Meaning the above workaround isn't necassary.  NS 4 will still not recieve compressed CSS and JS but all modern browsers will.



Very cool (none / 0) (#15)
by kevin on Thu Mar 20, 2008 at 12:01:03 PM PST

Very cool. Can you tell if it's working at all? Did you have to do any fooling with the configuration files? Kevin Sender



This is nice (none / 0) (#16)
by Flex on Thu May 01, 2008 at 08:21:35 AM PST

WebcamSex | Webcam Sex | Sex Cam
WebcamSex | Webcam Sex | Sex Cam



scoop and mod_gzip | 16 comments (16 topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search