How to configure Apache Server for not gziping response to Apache Commons Http Client

In the Decoding the gziped response in HttpClient entry i demonstrated a sample of how you can decode the gzip response in Apache HttpClient program.

But if you are calling a URL of your own site then you might not want to first compress response on the producer and decompress response on the consumer side. Or your web site is already accessed by lot of other java programs and now if you start gzipping response your afraid that it might break existing clients.

If thats the case then you can figure out what is value of User-Agent header when request is made by Java client, In case if your using Apache Jakarta Commons Http Client, the User Agent header would be set like this

User-Agent Jakarta Commons-HttpClient/3.1

If your using Apache Server for gzipping your response, you can add BrowerMatch statement like this to tell Apache server not to gzip response if the client is Jakarta commons http client

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/json

BrowserMatch ^Jakarta Commons-HttpClient no-gzip


srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

Vikas Chaudhary said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

EG MEDI said... is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store