Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4249596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:25:05+00:00 2026-05-21T04:25:05+00:00

Imagine these two chunks of code residing in htaccess for speeding up the website.

  • 0

Imagine these two chunks of code residing in htaccess for speeding up the website.
With php 5.2.3 on apache 2.0

block A

# preserve bandwidth for PHP enabled servers
<ifmodule mod_php4.c>
    php_value zlib.output_compression 16386
</ifmodule>

block B

# compress speficic filetypes
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|eot|ttf|svg|xml|ast|php)$">
    SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

Questions that arise:

Q1. Is this the proper way to combine these two blocks A + B into 1 htaccess in the root?

Q2. Is it correct that on the second block B, |php| is used again in the mod_edflate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:25:06+00:00Added an answer on May 21, 2026 at 4:25 am

    If mod_deflate is loaded and you can control apache configuration then you should let apache do output compression. Doing compression in php is always going to be slower. Here is my recommended config for your htaccess:

    <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
    </IfModule>
    

    I think a blacklist is more effective in this case since there are very few types of files you don’t want compressed. This way you make sure to compress everything else, even those types of files you can’t remember to add to a whitelist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine these two classes: class Part { public string Name { get; set;} public
Hello (please excuse me for my ugly english :p), Imagine these two simple models
Imagine two positive integers A and B. I want to combine these two into
Imagine I have these python lists: keys = ['name', 'age'] values = ['Monty', 42,
I came across the following weird chunk of code.Imagine you have the following typedef:
Imagine that we have two tables as follows: Trades ( TradeRef INT NOT NULL,
I hope this isn't too subjective. I can't decide between these two design opportunities.
Imagine two servers (each within an own jvm process) which communicate using some form
Imagine the following two ejb3.0 stateless session beans, each implements a local interface and
Imagine you've been given two System.Type's and you want to determine if there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.