Bug 704294 - enable GZIP compression for the 25 MB xxxxx.cache.html and other large text files (e.g. SmartClient js files) served up by coregui
Summary: enable GZIP compression for the 25 MB xxxxx.cache.html and other large text f...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core UI
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Charles Crouch
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon3
TreeView+ depends on / blocked
 
Reported: 2011-05-12 17:31 UTC by Ian Springer
Modified: 2015-02-01 23:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-03 16:56:39 UTC
Embargoed:


Attachments (Terms of Use)

Description Ian Springer 2011-05-12 17:31:07 UTC
This will make initial load of the RHQ GUI significantly faster for users with slow network connections between their RHQ Server and their web browser.

There are a few ways this can be done:

1) Configure Tomcat to do the compression at the HTTP(S) connector level - see http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
2) Configure a servlet filter that does the compression - see http://raibledesigns.com/rd/entry/the_battle_of_the_gzip
3) Configure GWT to do the compression (only available in GWT 2.1 or later, so this is not an option util we upgrade GWT) - see http://code.google.com/p/google-web-toolkit/wiki/PrecompressLinker

I think 1) is the way to go, since the Tomcat code is most likely fairly battle-hardened.

Comment 1 Ian Springer 2011-05-12 18:41:21 UTC
Approach 1 has been implemented - [master b93c06c].

Specifically, the following attributes were added to the http and https connectors in the RHQ Server's Tomcat/JBossWeb server.xml:

compression="51200"
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"

which tells Tomcat to GZIP compress html, plaintext, javascript, or css files larger than 50K, if the client browser supports GZIP compressed responses (I'm pretty sure all of our supported browsers do).

Before configuring compression, the very first load of coregui took about 30 seconds for me. After adding it, it took only 10 seconds (3x faster!). And my browser was on the same machine as my RHQ Server - the savings for remote clients will be even greater.

Comment 2 Ian Springer 2011-05-12 18:43:26 UTC
Note, we should consider switching to approach 3) once we've upgraded to GWT 2.1 or later, since the GWT preecompress filter supports precompression of the files as well as caching of the compressed files, whereas Tomcat always (re)compresses the files on demand.

Comment 3 Mike Foley 2011-05-24 13:06:52 UTC
documenting the verification as follows:

1)  I see gzip in the HTTP request header (from Firebug), as documented below

Server	Apache-Coyote/1.1
X-Powered-By	Servlet 2.4; JBoss-4.2.0.CR2 (build: SVNTag=JBoss_4_2_0_CR2 date=200704160918)/Tomcat-5.5
Date	Tue, 24 May 2011 12:50:06 GMT
Expires	Wed, 23 May 2012 12:50:06 GMT
Cache-Control	max-age=31536000
Etag	W/"27453741-1306165444000"
Last-Modified	Mon, 23 May 2011 15:44:04 GMT
Content-Type	text/html
Content-Encoding	gzip        <<<<<<<<<<<<<<<VERIFICATION<<<<<<<<<<
Vary	Accept-Encoding
Request Headersview source
Host	localhost:7080
User-Agent	Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.6.17-1.fc14 Firefox/3.6.17
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
Referer	http://localhost:7080/coregui/
Cookie	RHQ_Session=-703695851; JSESSIONID=984E5DDB15234CB39D8743336288AC5A; sahisid=sahi_3c40d04800a93045340834b0dc8d6aea7e65


2) a Firefox plugin called "YSlow" grades RHQ with a "B" for gzip compression.

Comment 6 Heiko W. Rupp 2013-09-03 16:56:39 UTC
Bulk closing of old issues that are in VERIFIED state.


Note You need to log in before you can comment on or make changes to this bug.