|
Re: Compression of communication in Rap 2.0 [message #968137 is a reply to message #965910] |
Fri, 02 November 2012 08:07 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Sebastian,
currently, client can't handle compressed JSON. Please file an
enhancement request about this issue.
Thanks,
Ivan
On 10/31/2012 6:17 PM, Sebastian von Klinski wrote:
> Under rap 1.4 it was possible to compress the communication with the
> org.mortbay.servlet.GzipFilter by adding a filter extension
>
> <extension
> point="org.eclipse.equinox.http.registry.filters">
> <filter
> alias="/"
> class="org.mortbay.servlet.GzipFilter"
> httpcontextId="org.eclipse.rap.httpcontext"
> load-on-startup="true">
> </filter>
> </extension>
>
> This compression dramatically accelerated the communication and thus
> improved the GUI performance.
>
> Under Rap 2.0 the jetty version 8.1.3 is used. There, the GZipFilter
> has been moved to the jetty.servlets package, which is no default
> plugin of eclipse. I added the respective jar files from the eclipse
> jetty 8.1.5 distribution (jetty-distribution-8.1.5.v20120716.zip).
>
> However, rap always crashes when a http filter is added with the new
> GzipFilter.
>
> Can anybody tell me, how it is possible to compress the JSON-Messages
> under Rap 2.0?
>
> Thanks in advance,
>
> Sebastian
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
|
Re: Compression of communication in Rap 2.0 [message #968512 is a reply to message #968448] |
Fri, 02 November 2012 14:19 |
|
Sebastian,
I use Apache as a front-end for my RAP application and let it handle gzip compression using mod_deflate. The only thing I had to add to the default config is to have it compress "application/json". I am using RAP 1.5, but it uses the JSON protocol as well so it should be similar to 2.0. Below is the configuration for mod_deflate. I am running Ubuntu Linux, so this is in /etc/apache2/mods-available/deflate.conf, be sure to enable the module as well. I confirmed with the Chrome web inspector that json requests are using gzip compression and tested with IE9 as well.
<IfModule mod_deflate.c>
# these are known to be safe with MSIE 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml
# everything else may cause problems with MSIE 6
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript application/json
AddOutputFilterByType DEFLATE application/rss+xml
</IfModule>
If it works with Apache then it should work with Jetty as well, but I'm not sure how to configure Jetty properly. It may be that you need to configure the filter to only compress certain types of content as done with Apache.
Hope that helps,
Cole
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10937 seconds