]> source.dussan.org Git - jgit.git/commit
Compress large /info/refs responses on HTTP 46/7846/1
authorShawn O. Pearce <spearce@spearce.org>
Thu, 20 Sep 2012 00:33:07 +0000 (17:33 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 20 Sep 2012 00:33:07 +0000 (17:33 -0700)
commitf93a6a72290d475d080b1e76de58a21934422e90
treeb06eb5d42711d10bf68049a246c1dbbde2616276
parentc9cce254c7e928770763be309573b6cfd0a5ee4e
Compress large /info/refs responses on HTTP

Enable streaming compression for any response that is bigger than
the 32 KiB buffer used by SmartOutputStream. This is useful on the
info/refs file which can have many branches and tags listed, and
is often bigger than 32 KiB, but also compresses by at least 50%.

Disable streaming compression on large git-upload-pack responses,
as these are usually highly compressed Git pack data. Trying to
compress these with gzip will only waste CPU time and additional
transfer space with the gzip wrapper. Small git-upload-pack data
is usually text based negotiation responses and can be squeezed
smaller with a little bit of CPU usage.

Change-Id: Ia13e63ed334f594d5e1ab53a97240eb2e8f550e2
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java