I help a friend run a web site that has a large number of files and takes up quite a bit of disk space. Sadly, I don't have infinite disk space and with the other things we want to do with the site, doubling the space usage isn't really an option.

So that said, I was looking into what mod_perl modules can help and Apache::DynaGzip or Apache::Compress seemed to fit the bill but only from a bandwidth viewpoint. My idea is the possibility of archiving all my HTML pages (ie creating index.html.gz) and then only decompressing the page should the client NOT support gzip encoded pages. The links in the pages would still be just 'index.html' etc.

So that leads me to this RFC. I think this has a practical application on my server as I can apply the same treatment to areas of high traffic.

My initial thoughts were to somehow extend Dynagzip or at least act as a proxy object to it. I can then choose to add this extra level of compression at the Apache config file level and so control what I do by location, file extension and directory as you would with other modules and directives.

This seems to be the way to go as reading its documentation it handles 99% of the things I would want. However, in all honesty this would be my first mod_perl module and so am a bit of a newbie in this area. I've got the Mod Perl cookbook and the Oreilly book so I am at least able to RTFM if booted in the right direction :). I have also read the content compression faq. As well as the other tutorials on perl.apache.org :)

So what do people think? Is this feasible, the right approach and does anyone have any suggestions/things for me to think about?

I'm running a Red Hat linux box with Apache 1.3.27, mod_perl 1.26 and Perl v5.6.1. I've already got Compress::Zlib v.1.14 and Apache::Compress v1.3 (they were pre-installed on this host). I don't, however, have Dynagzip installed though I am concerned by its low version number so would appreciate any comments on that too.

In reply to RFC: Mod Perl compressed content by simon.proctor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.