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

  • SEARCH
  • Home
  • 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 8438377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:41:52+00:00 2026-06-10T07:41:52+00:00

I am trying to use the bigpipe concept on our website. That means trying

  • 0

I am trying to use the bigpipe concept on our website. That means trying to send the response in chunks instead of sending it as a whole so that user feels that page is fast. I am successful in doing that by using the flushBuffer method on the response object in java. But now when I try to compress the content with apache mod_deflate module, chunking is lost.

Here is the configuration from apache used to compress the content

**

Begin mod_deflate config

DeflateBufferSize 100
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/httpd/deflate_log deflate

End mod_deflate config**

Here is the response header when the deflate is turned on in apache

Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:7916
Content-Type:text/html; charset=UTF-8
Date:Fri, 27 Jan 2012 20:11:11 GMT
Keep-Alive:timeout=300, max=3997
Server:Apache
Vary:Accept-Encoding

Response header when the deflate is turned off in apache

Connection:Keep-Alive
Content-Type:text/html; charset=UTF-8
Date:Fri, 27 Jan 2012 20:21:14 GMT
Keep-Alive:timeout=300, max=3997
Server:Apache/2.2.3 (CentOS)
Transfer-Encoding:chunked

As you can see in above 2 headers chunking is working only if the compression is turned off. I was searching on internet regarding this and people were suggesting to decrease the DeflateBufferSize value. I decreased the value to 100 bytes as you can see in my apache config but that still didn’t solve the problem. DeflateBufferSize set to 100 bytes means that response is buffered in apache till 100 bytes are received and then the it is compressed.

I was looking at the mod_gzip module which was bundled with the old apache 1.3 and that module has a following directive which allows chunked content to be gzipped.

mod_gzip_dechunk Yes

Does anyone know of such directive in mod_deflate bundled with apache 2.x?

Or Does anyone know how to compress the chunked content?

  • 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-06-10T07:41:54+00:00Added an answer on June 10, 2026 at 7:41 am

    Actually I found the solution. I used to create a new object of GZipOutputStream each time to flush different chunks. Instead you should create one object only of GZipOutputStream and then used that object for compressing all the chunks of the response. Also I put a wrapper around GZipOutputStream. Here is the wrapper that I got from googling around.

    public class GZIPFlushableOutputStream extends GZIPOutputStream {
    
        public GZIPFlushableOutputStream(final OutputStream out) throws IOException {
            // Using Deflater with nowrap == true will ommit headers and trailers
            super(out);
        }
    
        private static final byte[] EMPTYBYTEARRAY = new byte[0];
    
        /**
         * Insure all remaining data will be output.
         */
        public void flush() throws IOException {
            /**
             * Now this is tricky: We force the Deflater to flush its data by
             * switching compression level. As yet, a perplexingly simple workaround
             * for
             * 
             * http://developer.java.sun.com/developer/bugParade/bugs/42557 43.html
             */
            def.setInput(EMPTYBYTEARRAY, 0, 0);
    
            def.setLevel(Deflater.NO_COMPRESSION);
            deflate();
    
            def.setLevel(Deflater.DEFAULT_COMPRESSION);
            deflate();
    
            out.flush();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use the RHEL5.3 GCC 4.3.2 compiler to build my software on that
I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
I am trying use a from a multi-dimensional array that I create in another
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
I am trying use the jQuery table sorter plugin for a table that is
I am trying use the mysql connector in c++ in ubuntu. It appears that
I'm trying to create a script that will delete all user properties for a
I am trying use this example http://www.sajithmr.me/jrecorder/example2.html for recording audio and send it to
I am trying use open graph API to publish an action. URL that I

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.