I have a weird problem on my production web server running Apache on Ubuntu: it compresses my images thereby dramatically lowering their quality!

Actually I have two virtual hosts running, each located in a different folder. Wether I display .gif images by navigating on the two sites, or acceding them directly by their url, their size and quality are invariably degraded.

I tried with three different browsers: same problem. Using them on other sites on the Web: no problem. Of course I disabled mod_deflate on the server (which should not compress images anyway), but the phenomenon remains.

On my local développement server, running the same configuration, everything is Ok.

Now I'm completely lost!

For the record, my configuration: Ubuntu 10.04, Apache 2, Php 5.

2 Answers 2


This might be mod_pagespeed, which has filters to "optimize" images.

Unfortunately without posting your Apache configuration, it's impossible to tell. You might find apache2ctl -t -D DUMP_MODULES useful to list the modules currently loaded into your web server.

  • mod_pagespeed is not loaded according to apache2ctl.
    – Billy Bob Thornton
    Nov 27, 2011 at 5:25

In Apache, the Content Negotiation can be finely configured for different media types. For Image types such as image/jpeg, image/gif etc, there's an option to serve them at different qualities.

With any luck you may have some directives that look like this: Accept: image/gif, image/jpeg; q=0.40 in your httpd.conf/apache.conf

For more info, see the Content Negotiation section in the Apache Documentation.

  • Thanks. No, there is no such thing in the apache conf file(s). Nov 27, 2011 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.