Thanks Sri! This is excellent.

Brad

On Mar 31, 4:35 am, Sripathi Krishnan <[email protected]>
wrote:
> You don't have to set the Accept-Encoding header yourself. The browser will
> automatically be set the header if it understands gzip. Your client code
> doesn't have to change at all to handle gzip.
>
> On the server side, you do the following  -
>
>    1. Check if the browser understands gzip
>    2. If yes, actually compress the response and set the appropriate header
>    to indicate its a compressed stream
>    3. If no, send uncompressed header
>
> See GWTs Server code that does this logic -
>
>    1.
>    http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/...
>    2.
>    http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/...
>
> --Sri
>
> On 31 March 2010 06:50, bradrover <[email protected]> wrote:
>
>
>
> > Well forget that error message... I'm just trying to figure out now
> > why my RequestBuilder Accept-Enc0ding header is not being used. I add
> > this code:
>
> > requestBuilder.setHeader("Accept-Encoding", "gzip, deflate");
>
> > and I get this result in chrome for request headers:
>
> > Referer:http://localhost:8080/SdssThinClient/sdssthinclient/
> > C72C3F6B8BCFC032CD4680AC42BFDF51.cache.html
> > User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/
> > 533.3 (KHTML, like Gecko) Chrome/5.0.360.4 Safari/533.3
>
> > seems like this is pretty straightforward, so i don't get it....
>
> > On Mar 30, 8:18 pm, bradrover <[email protected]> wrote:
> > > I'm probably doing this wrong,but I compressed the xml file to a zip,
> > > when I request the zip file using RequestBiulder in hosted mode
> > > running Chrome it crashes the plug-in.
>
> > > com.google.gwt.dev.shell.BrowserChannel$RemoteDeathError: Remote
> > > connection lost
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForRetur
> > n(BrowserChannel.java:
> > > 1730)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann
> > elServer.java:
> > > 165)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
> > > 120)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
> > > 507)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
> > > 264)
> > >     at
>
> > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j
> > ava:
> > > 91)
> > >     at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
> > >     at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
> > >     at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
> > >     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> > l.java:
> > > 25)
> > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > >     at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >     at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >     at
>
> > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> > a:
> > > 157)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java
> > :
> > > 1668)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan
> > nelServer.java:
> > > 401)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java
> > :
> > > 222)
> > >     at java.lang.Thread.run(Thread.java:619)
> > > Caused by: java.net.SocketException: Connection reset by peer: socket
> > > write error
> > >     at java.net.SocketOutputStream.socketWrite0(Native Method)
> > >     at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:
> > > 92)
> > >     at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
> > >     at
> > > java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
> > >     at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:
> > > 123)
> > >     at java.io.DataOutputStream.flush(DataOutputStream.java:106)
> > >     at com.google.gwt.dev.shell.BrowserChannel
> > > $ReturnMessage.send(BrowserChannel.java:1341)
> > >     at com.google.gwt.dev.shell.BrowserChannel
> > > $ReturnMessage.send(BrowserChannel.java:1346)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForRetur
> > n(BrowserChannel.java:
> > > 1716)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann
> > elServer.java:
> > > 165)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
> > > 120)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
> > > 507)
> > >     at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
> > > 264)
> > >     at
>
> > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j
> > ava:
> > > 91)
> > >     at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
> > >     at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
> > >     at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
> > >     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> > l.java:
> > > 25)
> > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > >     at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >     at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >     at
>
> > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> > a:
> > > 157)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java
> > :
> > > 1668)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan
> > nelServer.java:
> > > 401)
> > >     at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java
> > :
> > > 222)
> > >     at java.lang.Thread.run(Thread.java:619)
>
> > > On Mar 30, 6:42 pm, Sripathi Krishnan <[email protected]>
> > > wrote:
>
> > > > You don't have to do anything special on the client side - the browser
> > will
> > > > automatically deflate it before you get the content. Just make sure
> > that
> > > > your server side code respects accept-encoding request header before
> > sending
> > > > down a compressed file.
>
> > > > --Sri
>
> > > > On 31 March 2010 02:02, bradrover <[email protected]> wrote:
>
> > > > > I have some larger xml files than I 'd like, but I need to pull them
> > > > > down and parse them client side. If I zip these up can I still use
> > > > > RequestBuilder to get the content to the client and deflate it, or is
> > > > > there a better way ?
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "Google Web Toolkit" group.
> > > > > To post to this group, send email to
> > [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<google-web-toolkit%2Bunsubs
> > > > >  [email protected]><google-web-toolkit%2Bunsubs
> > [email protected]>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%2Bunsubs 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to