Conditionally gzip files based on available compression library

I am trying to set up gzip compression on a website, but we are not sure where it will be hosted and I want to be able to support mod_gzip if it's available.

What I'd like to do is something like this:

<IfModule mod_gzip.c>
  # mod_gzip rules
<IfOtherModule mod_deflate.c>
  # mod_deflate rules
</IfModule>

Do apache configs allow this? Is mod_deflate smart enough not to work if mod_gzip has already done its thing?

Answers


<IfModule mod_gzip.c>
  # mod_gzip rules
</IfModule>

<IfModule !mod_gzip.c>
  <IfModule mod_deflate.c>
    # mod_deflate rules
  </IfModule>
</IfModule>

Although I would change the order around and first try mod_defate. mod_gzip is no longer under development so you are better of using mod_deflate (which by the way also uses gzip, and not deflate, as the name might suggest).


Need Your Help

Retrieving values from for loop into jquery

javascript c# jquery

How do I retrieve values from @for loop into jquery..Each value inside for loop should have different id, and jquery should get each separate id....

Finding possibility of occurrence of words in a document using bloom filter

algorithm data-structures bloom-filter

I have a list of words like - list1 = [boy, apple, mango, car] and I have two documents with following content: